Hi Friends,

Here I am going to explain the SQL Server Batch Separator GO.

Batch: Batch is a group of one or more TSQL statements submitted to SQL server for the execution.

1- To separate batches we use batch  separator “GO”

for example :

2- you can also use GO to define how much times you want to execute your batch.

Syntax: GO [count]

where count is a positive integer.

for example :

1_SQL_Server_SQL Server_Batch_Separator_GO

3- GO is a utility command. So utilities never send GO to sql server.

4- playing with GO, means you can change this Batch Separator ‘GO’ with another option like ‘OK’

OPEN SSMS -> TOOLS -> Options

2_SQL_Server_SQL Server_Batch_Separator_GO

Now a popup window open here click on Query Execution in left side of this window.

3_SQL_Server_SQL Server_Batch_Separator_GO

here you can chage the text for batch separator. in my case i just type ok.

Now just restart the ssms to use the new batch separator

now we can use it as

NOTE : Changeing batch separator is not a good idea. here we changed batch separator in SSMS only, this can not change GO as batch separator in sqlcmd utility. suppose if        you run some TSQL script on your server,created by another person on another server using batch separator GO, then it will give errors on your server.

 

Regards

Prince Rastogi

Like us on FaceBook Follow us on Twitter | Join the fastest growing SQL Server group on FaceBook

Follow me on TwitterFollow me on FaceBook