FIX: Db_owner Role Members Cannot Use sp_[un]bindrule and sp_[un]bindefault (234174)



The information in this article applies to:

  • Microsoft SQL Server 7.0

This article was previously published under Q234174
BUG #: 54274 (SQLBUG_70)
BUG#: 55554 (SQLBUG_70)

SYMPTOMS

Although a member of the db_owner role is successfully able to execute the sp_bindefault stored procedure, the default will not be correctly supplied when an INSERT statement is run and a value is not specified.

Additionally, db_owner role members receive error 15104 if they attempt to run sp_unbindefault, sp_bindrule, or sp_unbindrule:
Msg 15104, Level 16, State 1
You do not own a table named 'dbo' that has a column named 'Today'.

CAUSE

The owner qualifier in the object name is optional. When specified, these system stored procedures are not correctly handling the parameter. Note that in the error 15104 message, the table name is given as 'dbo' rather than the actual table name.

WORKAROUND

To work around this problem, run the command as the actual database owner (DBO), rather than a db_owner role member, and omit the optional object owner qualifier from the command. For example, instead of doing the following:
EXEC sp_bindefault 'dbo.MyDefault', 'TestTable.TestColumn'
				
Use a command like the one below:
EXEC sp_bindefault 'MyDefault', 'TestTable.TestColumn'
				

STATUS

Microsoft has confirmed this to be a problem in SQL Server 7.0. This problem has been corrected in U.S. Service Pack 2 for Microsoft SQL Server 7.0. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

254561 INF: How to Obtain Service Pack 2 for Microsoft SQL Server 7.0 and Microsoft Data Engine (MSDE) 1.0

For more information, contact your primary support provider.

MORE INFORMATION

SQL Server 7.0 Books Online does not explicitly mention that permissions to these procedures are also granted to db_owner role members. However, this permission is consistent with the purpose and design of roles in SQL Server 7.0.

Modification Type:MajorLast Reviewed:3/14/2006
Keywords:kbBug kbfix KB234174