tsql - How to force sql server to execute one command at a time without using GO? -


I would like to ensure that a series of serials is executed serially, such as

  Updates tab 1 ... Update tab 3 ... Update tab 3 ...  

I like it update TABLE2 only starts When the update TABLE1 is completed.

Of course I can do it with:

  Update tab 1 ... Go tab update ... Update tab ... Go tab. .   

But in this case I will lose all local variables.

Is there an easy way to meet my needs? Thank you.

You do not need to do this; GO causes a batch to be sent to the server at that time. As long as you put the order in a script sequentially, then they will execute each other as you want. You must do extra work to run them in parallel


Comments