How to force the SQL server to execute one command at a time without using GO?

I would like to make sure that a series of commands is executed sequentially, for example, in

update TABLE1...
update TABLE2...
update TABLE3...

I would like to update TABLE2start only after completion update TABLE1.

Of course, I can do this with GO:

update TABLE1...
GO
update TABLE2...
GO
update TABLE3...
GO

But in this case, I will lose all local variables.

Is there an easy way to accomplish what I need? Thank.

+3
source share
2 answers

GO ; GO . script, , . ,

+3

. , . , ?

: " , " , - , . GO script , .

+2

Source: https://habr.com/ru/post/1766795/


All Articles