Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 GO [count]

Author  Topic 

TG
Master Smack Fu Yak Hacker

6065 Posts

Posted - 2008-11-12 : 13:15:36
Don't know why I've never noticed before this but it's pretty cool.

select getdate()
go 3


Sorry stating the obvious for those of you who were well aware of this

Be One with the Optimizer
TG

acollins74
Yak Posting Veteran

82 Posts

Posted - 2008-11-12 : 13:24:21
What a great way to load sample data.
I have never come across that before. ...bet you have raised a few eyebrows with that one.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2008-11-12 : 13:28:44
i also was unaware of this until i saw the below blog

http://sqlblogcasts.com/blogs/madhivanan/archive/2008/08/06/another-use-of-go-command-in-sql-server-2005.aspx
Go to Top of Page

acollins74
Yak Posting Veteran

82 Posts

Posted - 2008-11-12 : 14:10:48
Its fun to apply what we learned. Anybody for a game of Dice...

DECLARE @dice as INT
set @dice = (SELECT right(RAND(DATEPART(ms, GETDATE()) ),1))
WHILE (@dice >6)
BEGIN
set @dice = (Select right(RAND(DATEPART(ms, GETDATE()) ),1))
END
SELECT @dice
go 2
Go to Top of Page

Vinnie881
Master Smack Fu Yak Hacker

1231 Posts

Posted - 2008-11-12 : 14:45:06
This is a great trick when running stats on a query.




Success is 10% Intelligence, 70% Determination, and 22% Stupidity.
\_/ _/ _/\_/ _/\_/ _/ _/- 881
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2008-11-13 : 01:29:55
Also dont forget to read this
http://sqlblogcasts.com/blogs/madhivanan/archive/2008/09/05/fun-with-go.aspx

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

lionofdezert
Aged Yak Warrior

885 Posts

Posted - 2008-11-13 : 02:50:25
Thats kool, thanx TG
Go to Top of Page
   

- Advertisement -