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
 General SQL Server Forums
 New to SQL Server Programming
 The Go Statement

Author  Topic 

a_r_satish
Yak Posting Veteran

84 Posts

Posted - 2006-03-28 : 02:00:11

I know that the Go stmt is used to execute the queries in batch. But i didnt find the exact usage of the stmt. Can Anyone help me with the exact usage and the combinations where to use the Go Stmt.
Coz i have not yet encountered any prob as of now...

Thanks in advance.

Regards,
satish.r
"Known is a drop, Unknown is an Ocean"

chiragkhabaria
Master Smack Fu Yak Hacker

1907 Posts

Posted - 2006-03-28 : 02:18:39
According to Book online
quote:

Signals the end of a batch of Transact-SQL statements to the Microsoft® SQL Server



Normally Go is used when you are running DDL queries like create, alter.. or if you want to run the queries in a particular batch..



If Debugging is the process of removing Bugs then i Guess programming should be process of Adding them.
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-03-28 : 02:48:26
Read about GO in sql server help file for more information

Madhivanan

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

ravilobo
Master Smack Fu Yak Hacker

1184 Posts

Posted - 2006-03-28 : 07:50:05
GO is a BATCH seperator,

DECLARE @i int 
SELECT @i= 10

SELECT @i
GO

SELECT @i -- Gives the error


At the same time GO is not ANSI SQL. You can have any other batch seperator instead of GO
Query Analizer->Tools->Options->Connections->Batch seperator ....change the seperator here...

------------------------
I think, therefore I am - Rene Descartes
Go to Top of Page
   

- Advertisement -