What is the difference between ; and GO in stored procedure in SQL Server?

后端 未结 5 2258
佛祖请我去吃肉
佛祖请我去吃肉 2021-02-18 18:16

What is the difference between ; and GO in stored procedure in SQL Server ?

Actually, if I have a stored procedure in SQL server and wanna to p

5条回答
  •  后悔当初
    2021-02-18 18:58

    ; just ends the statement.

    GO is not a statement but a command to the server to commit the current batch to the Database. It creates a stop inside the transaction.

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

    (Update, thanks for the comments):
    GO is a statement intended for the Management studio as far as I know, maybe to other tools as well.

提交回复
热议问题