BUG: Stored Procedure Names Starting with 'go' Cause Syntax ErrorsID: Q201545
|
Stored Procedure names that start with the letters 'go' are treated by the Query Analyzer (ISQLW.EXE) utility as an action statement. Execution of such stored procedures may fail with the following error message:
The stored procedure name listed in the message will be the name of the procedure without the first two letters 'go'.Server: Msg 2812, Level 16, State 62, Line 1
Could not find stored procedure 'XXX'.
SQL Server query utilities use the keyword 'go' as the default delimiter for a batch of TSQL commands. The utility submits incorrect commands to the SQL Server. In the example, when calling a procedure name 'got_entries' from Query Analyzer, the query submitted to SQL Server is 't_entries' not 'got_entries'.
The GUI query utility sees the 'go' pattern as the standard action in a Transact-SQL (TSQL) sequence.
To workaround this problem, you can either:
In the Query Analyzer, from the Query menu, choose Current Connection
Options and set the 'TSQL Batch Separator' to something other than
'go'
Microsoft has confirmed this to be a problem in SQL Server version 7.0.
Here is an example of the error:
create procedure got_entries as print 'Hello'
go
got_entries
go
RESULT: The following error occurs:
Server: Msg 2812, Level 16, State 62, Line 1
Could not find stored procedure 't_entries'.
Additional query words:
Keywords : kbSQLServ700 kbSQLServ700bug
Version : winnt:7.0
Platform : winnt
Issue type : kbbug
Last Reviewed: April 23, 1999