No nonsense, please read the detailed below.
Use Db_csharp
go
select *,
remark =case when
grade>=90 then ' excellent results ' when
grade<90 and grade>=80 Then ' good grades ' when
grade<80 and grade>=70 Then ' fail '
Else ' fail ' End from
Tb_grade
If you're just executing a statement, there's no go.
It's different if multiple statements are separated by a go partition.
Each go-delimited statement is a separate transaction, and a statement execution failure does not affect the execution of other statements.
For example:
First execute the following statement at the same time
SELECT * from sysobjects where id=a
select GETDATE ()
You will find an error, and no result set will be displayed.
And you do it again.
SELECT * from sysobjects where id=a
go
select getdate ()
go
You will find that, although the error is the same, the result set contains the result of the Select GETDATE ().
Use of Go in Ps:sql SERVER
Signals the end of a batch of Transact-SQL statements by Microsoft®sql Server™ utility.
Go is NOT a Transact-SQL statement, but a command that can be identified for osql and isql utilities and SQL Server Query Analyzer.
If your SQL is too long, to write go, or some statements, it can only be the first line of operation, before you have to write go, it means that the batch processing statement with this go, to carry out the line code, execute and then execute the next code ...
In cases like this, go, batch processing data ...
Use master
go
if exists (SELECT * from sysdatabases where name = ' kejiandb ')
drop database kejiandb
go
create database kejiandb go to
kejiandb
Go
-(industry table)
CREATE TABLE Trade
(
tra_id int Primary key identity (1,1) NOT null--industry ID (primary key, self-growing)
tra_name varchar () NOT null-industry name) go
The above is the entire narrative of this article, I hope you like.