Getting Started with Adobe After Effects - Part 6: Motion Blur
A collection of quick technology learning tips from what people around you learn every day

Sql Server - 'GO N' clause will repeat batch N Times

Sep 1 2011 9:44AM by Sandeep Prajapati   

In SQL Server, 'Go N' will execute the bunch of commands within the batch 'N' times

Create Table #Temp(SerialNo int identity Primary key, Product varchar(500))
go

Declare @Product varchar(500)='Mouse'
insert into #Temp(Product)
select @Product
GO 20

select * from #Temp
drop Table #Temp
Read More..   [0 clicks]

Published under: SQL Server Tips ·  ·  ·  · 


Sandeep Prajapati
61 · 3% · 926
15
 
4
 
12
 
0
Incorrect
 
0
Interesting
 
0
Forgotten



Submit

5  Comments  

  • To be more accurate, If the batch separator in SSMS is configured as "GO" then SSMS will execute the given TSQL statement "N" times if it is followed by "GO N".

    Keep in mind that, GO is not a SQL Server command. It is just a separator that SSMS uses it. Also, remember that you can change the batch separator from GO to something else too.

    commented on Sep 1 2011 9:59AM
    Jacob Sebastian
    1 · 100% · 32235
  • Thanks jacob for specification.

    I didn't know about Batch separation configuration in SSMS.

    Thanks Paresh Prajapati. for great example.

    commented on Sep 1 2011 1:21PM
    Sandeep Prajapati
    61 · 3% · 926
  • This feature started with SQL Server 2005.

    commented on Sep 2 2011 4:41PM
    Cris
    194 · 1% · 242

Your Comment


Sign Up or Login to post a comment.

"Sql Server - 'GO N' clause will repeat batch N Times" rated 5 out of 5 by 15 readers
Sql Server - 'GO N' clause will repeat batch N Times , 5.0 out of 5 based on 15 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]