GO Keyword with Integer Parameter


In SQL Server the keyword GO tells SQL Server to execute the preceding code as one batch. From SQL Server 2005 onwards we can specify the integer parameter with GO keyword which will loop the preceding statement.

Example

create table jugal
(
name varchar(100) default ‘jugal shah’
)
— below command will insert the default value two times as we have specified 2 as parameter
insert into jugal values(default)
go 2

— below command will print ‘Jugal Shah’ 100 times as we have specified 100 as parameter
print ‘jugal shah’
go 100

Advertisements

Thanks for the comment, will get back to you soon... Jugal Shah

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s