Quantcast
Channel: Transact-SQL forum
Viewing all articles
Browse latest Browse all 23857

SQL 2008R2: Will SQL process statements (updates/inserts) in order?

$
0
0

Hello SQL Experts,

I have some code that updates/inserts some data in a SQL database/table. After reviewing the code in action, I realized that I am opening and closing the SQL connection with each update/insert. I want to make it more efficient as there could be 1000's of "transactions" happening very quickly. My question is: Will SQL process updates/inserts in the order it receives them if all submitted at once?

For example: If I submit the below statements at the same time, will SQL process them in the order they are in? or will it randomly process them (possibly out of order)? Is there a way to force SQL to process them in order?

UPDATE databaseA.dbo.TableA SET MyColumn='ColumnValue';
UPDATE databaseA.dbo.TableA SET MyOtherColumn='MyOtherColumnValue';

 Thank you in advance!!


Viewing all articles
Browse latest Browse all 23857

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>