Getting Started with Adobe After Effects - Part 6: Motion Blur


Upload Image Close it
Select File

Browse by Tags · View All
sql_server 217
t-sql 211
tsql 116
sqlserver 96
BRH 78
#SQLServer 66
#TSQL 56
SQL Server 34
function 11
SSMS 9

Archive · View All
August 2007 17
August 2010 8
June 2012 7
June 2011 7
November 2007 7
August 2012 6
May 2012 6
November 2011 6
August 2011 6
October 2011 6

Madhivanan's TSQL Blog

Another use of GO command in SQL Server 2005

Aug 6 2008 9:43AM by Madhivanan   

As you all know, GO command signals the end of the batch of T-SQL statements

However in SQL Server 2005, it is also used to execute set of commands for a specified number of times

Consider that you want to create a table that should have hundred random integer values. You can the methods like the ones specified in http://beyondrelational.com/blogs/madhivanan/archive/2007/10/10/generating-random-numbers-part-ii.aspx or a while loop. 

You can also use GO command by specifying how many times it should run

create table #numbers(random_value int)
GO -- Signals the end of the batch

insert into #numbers(random_value) Select cast(100000*rand() as int)
GO 100 -- Signals that the above statement should run for 100 times

select random_value from #numbers
Now the table would have 100 random interger values

Here is Fun With Go

Tags: t-sql, sql_server, GO,


Madhivanan
3 · 40% · 12862
2 Readers Liked this
Jacob Sebastian Liked this on 4/8/2012 12:41:00 AM
Profile · Blog · Facebook · Twitter
Madhivanan Liked this on 4/16/2012 3:17:00 AM
Profile · Blog · Facebook · Twitter
2
Liked
 
0
Lifesaver
 
0
Refreshed
 
0
Learned
 
0
Incorrect



Submit

Your Comment


Sign Up or Login to post a comment.

"Another use of GO command in SQL Server 2005" rated 5 out of 5 by 2 readers
Another use of GO command in SQL Server 2005 , 5.0 out of 5 based on 2 ratings
    Copyright © Rivera Informatic Private Ltd Contact us      Privacy Policy      Terms of use      Report Abuse      Advertising      [ZULU1097]