Microsoft KB Archive/93414

{|
 * width="100%"|

The information in this article applies to:
 * Microsoft SQL Server version 4.2a for OS/2

BUG# OS/2: 1467 (4.2)

SYMPTOMS
The system stored procedure sp_dropuser does not drop a user in the current database if the user's login happens to be a dbo in other databases, even if the user is only a regular user in the current database.

Consider the following scenarios:

Assume you have two databases A and B, and a login name Joe. Joe is a regular user in database A, named Joe_A. Joe is also a dbo in database B. When the dbo in database A tries to drop Joe_A using sp_dropuser, the following error from the stored procedure will result:

You can't drop a database owner. This is an incorrect behavior, because Joe_A is not a dbo in database A.

CAUSE
SQL Server incorrectly checks the conditions in the system stored procedure sp_dropuser. The code for this system procedure checks if the user to be dropped is a dbo using the following query:

If exists (select * from sysdatabases        where suid = @suid) begin print (&quot;You can't drop a database owner&quot;) return(1) end If the stored procedure were for dropping a login name, the above condition would be correct. The correct condition should be:

if @uid = 1 begin print(......) return(1) end

WORKAROUND
Temporarily change the dbo in the other database to a different login name other than the user to be dropped.

STATUS
Microsoft has confirmed this to be a problem in SQL Server version 4.2a for OS/2. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.
 * }

-

Last reviewed: May 5, 1997

© 1998 Microsoft Corporation. All rights reserved. Terms of Use.