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 2000 Forums
 Transact-SQL (2000)
 Store Procedures

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-01-12 : 07:54:29
Israel writes "Hi,

I want use Go instruction in one Store Procedure, but if i compile it in the Query Analizer, the SQL Server 2000 truncate the Procedure in the first GO. For Example

Alter Procedure Example
Select * from X
Go
Select * from Y
Go
Select * from Z

After to compile, the SQL truncate to:
Select * from X


Only"

robvolk
Most Valuable Yak

15732 Posts

Posted - 2004-01-12 : 07:55:36
GO is not a command, it is a batch terminator, you can't use it in a stored procedure and you don't even need it anyway:

Alter Procedure myProcedure AS
Select * from X
Select * from Y
Select * from Z
Go to Top of Page
   

- Advertisement -