The role of Go in SQL

Source: Internet
Author: User
Tags getdate

Https://www.cnblogs.com/liuyaozhi/archive/2015/10/14/4877987.html

1Use Db_csharp2Go3SELECT *,4 notes =Case5 When grade>=Then‘ excellent  " 6 when grade<< Span style= "COLOR: #800080" >90 and Grade>=80 then  good score  '  7 when Grade<80 and Grade>=70 then  " pass  '  8 else  " inferior  '  9 end 10" Span style= "COLOR: #0000ff" >from tb_grade           
If you just execute a statement, there's no go all the same
It's different if you separate multiple statements with go.
Each statement that is delimited by Go is a separate transaction, and a statement execution failure does not affect the execution of other statements.
For example:
First, execute the statement below at the same time
SELECT * from sysobjects where id=a
Select GETDATE ()
You will find an error and will not show any result set
And you do it again.
SELECT * from sysobjects where id=a
Go
Select GETDATE ()
Go
You will find that the results of select GETDATE () are included in the result set, despite the same error.

The role of Go in SQL

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.