BUG: Stored Procedure Names Starting with 'go' Cause Syntax Errors

ID: Q201545


The information in this article applies to:
  • Microsoft SQL Server version 7.0

BUG #: 53819 (SQLBUG_70)

SYMPTOMS

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:

Server: Msg 2812, Level 16, State 62, Line 1
Could not find stored procedure 'XXX'.
The stored procedure name listed in the message will be the name of the procedure without the first two letters 'go'.


CAUSE

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.


WORKAROUND

To workaround this problem, you can either:

  • Change the name of the stored procedure to avoid starting with 'go'.

    -or-


  • Use the ISQL.exe or OSQL.exe command line utilities.

    -or-


  • Adjust your default 'TSQL Batch Separator' option:


  • 
         In the Query Analyzer, from the Query menu, choose Current Connection 
         Options and set the 'TSQL Batch Separator' to something other than 
         'go' 


STATUS

Microsoft has confirmed this to be a problem in SQL Server version 7.0.


MORE INFORMATION

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
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.