请问SQL语句中go有什么作用?

来源:百度知道 编辑:UC知道 时间:2024/06/05 01:49:31

查看sql的帮助即可,很详细地说。

GO
Signals the end of a batch of Transact-SQL statements to the Microsoft® SQL Server™ utilities.

Syntax
GO

Remarks
GO is not a Transact-SQL statement; it is a command recognized by the osql and isql utilities and SQL Query Analyzer.

SQL Server utilities interpret GO as a signal that they should send the current batch of Transact-SQL statements to SQL Server. The current batch of statements is composed of all statements entered since the last GO, or since the start of the ad hoc session or script if this is the first GO. SQL Query Analyzer and the osql and isql command prompt utilities implement GO differently. For more information, see osql Utility, isql Utility, and SQL Query Analyzer.

A Transact-SQL statement cannot occupy the same line as a GO command. However, the line can contain comments.

Users must follow the rules for batches. For example, any execution of a stored