SQL Server GO
For more information, see the following.
Use db_CSharpgo select *, remarks = case when Grade> = 90 then 'excellent score 'when Grade <90 and Grade> = 80 then' excellent score 'when Grade <80 and Grade> = 70 then' pass 'else' failed' end from tb_Grade
If you only execute a statement, all GO statements are the same.
If multiple statements are separated by GO, they are different.
Each statement separated by GO is a separate transaction. A statement execution failure does not affect the execution of other statements.
For example:
First, execute the following statement simultaneously.
select * from sysobjects where id=aselect getdate()
You will find that an error is reported and no result set is displayed.
And you can execute
select * from sysobjects where id=agoselect getdate()go
You will find that, even if an error is reported, the results include the results of select getdate.
Ps: SQL SERVER GO usage
Notify Microsoft by Signal®SQL Server™The end of a batch of Transact-SQL statements.
GO is not a Transact-SQL statement, but a command recognized by osql and isql utilities and SQL Server Query analyzer.
If your SQL statement is too long, you need to write GO or some statements. It can only be the first operation. You have to write GO before, GO means to add this GO to the batch processing statement, execute the code of the GO line, and then execute the following code ......
In such cases, GO is required to process data in batches ......
Use mastergoif exists (select * from sysdatabases where name = 'kejiandb') drop database kejianDBgocreate database kejianDBgouse kejianDBgo -- (Industry table) create table Trade (tra_Id int primary key identity (1, 1) not null, -- industry ID (primary key, auto-increment) tra_Name varchar (50) not null -- industry name) go
All of the above are described in this article. I hope you will like it.