GO Keyword with Integer Parameter
Posted by Jugal Shah on January 4, 2011
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
|
18.520469
73.856621
Like this:
Be the first to like this post.
This entry was posted on January 4, 2011 at 3:42 pm and is filed under Database, SQL Server, SQL Server 2008, SQL Server 2008 R2.
Tagged: GO keyword. You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.