FIX: User-Defined System Stored Procedures Must Be In Master

Last reviewed: April 9, 1997
Article ID: Q159901
The information in this article applies to:
  • Microsoft SQL Server, versions 6.0 and 6.5
BUG #: 16334 (6.5)

SYMPTOMS

There is a documentation error in the SQL Server 6.0 and 6.5 "Transact-SQL Reference." The documentation states that you can create a user-defined system stored procedure in a database other than the master database. This statement is incorrect; all user-defined system stored procedures should be created only by the system administrator (SA), and only in the master database. User-defined system stored procedures start with the prefix "sp_".

User-defined system stored procedures created in databases other than the master database may cause unexpected behavior regarding which objects are referenced. This problem is especially pronounced if multiple user-defined stored procedures with the same name exist in different databases. Due to the special name resolution rules for system stored procedures, there is no way to predict which of the two identically-named stored procedures are run.

WORKAROUND

Only the System Administrator should create user-defined system stored procedures, and these procedures should only be created in the master database.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft SQL Server versions 6.0 and 6.5 documentation. This problem has been corrected in U.S. Service Pack 2 for Microsoft SQL Server version 6.5. For more information, contact your primary support provider.

MORE INFORMATION

The "Transact-SQL Reference," under the User-defined System Stored Procedures heading, states:

   When executed, a stored procedure is typically found within the current
   database. If the procedure name begins with sp_ and is not found in the
   current database, SQL Server will look in the master database.

This statement incorrectly implies that you can create user-defined system stored procedures outside of the master database. The statement in Example H of the CREATE PROCEDURE Examples section is correct: "user-defined system stored procedures...must be created by the system administrator in the master database."


Additional query words:
Keywords : kbbug6.00 kbbug6.50 kbfix6.50.sp2 kbusage SSrvDoc_Err SSrvStProc
Version : 6.0 6.5
Platform : WINDOWS
Issue type : kbdocerr


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 9, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.