FIX: User-Defined System Stored Procedures Must Be In Master (159901)
The information in this article applies to:
- Microsoft SQL Server 6.0
- Microsoft SQL Server 6.5
This article was previously published under Q159901
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."
Modification Type: | Major | Last Reviewed: | 10/16/2003 |
---|
Keywords: | kbBug kbfix kbusage KB159901 |
---|
|