Can you force SQLCMD to immediately run each statement in a script without using "GO"?

When running a script in SQLCMD, is there a parameter, parameter, or any other way to get it to efficiently run the GO command at the end of each SQL statement?

This will prevent the need to embed periodic GO commands in very large scripts.

+3
source share
2 answers

No.

SQLCMD would have to implement the full T-SQL parser itself to determine where the boundaries of the report are. If currently exists, all he needs to do is find the lines with "GO" on them.

, , ";" - .

+6

, , , :

http://msdn.microsoft.com/en-us/library/ms162773.aspx

-c cmd_end . SQL Server, "GO" . reset , Transact-SQL, , .

....

; ; - ( , )

sqlcmd -c ;
+2

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


All Articles