Go usage in SQL Server

Source: Internet
Author: User
Tags sql server query

Use a signal to notify Microsoft SQL server of the completion 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 indicates that when the batch processing statement is added with this go, The go line is executed.Code, And then execute the following code ......
In such cases, go is required to process data in batches ......
Use master
Go
If exists (select * From sysdatabases where name = 'kejiandb ')
Drop database kejiandb
Go
Create Database kejiandb
Go
Use kejiandb
Go
-- (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

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.