Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Dropping Old Users

Author  Topic 

mk_garg20
Constraint Violating Yak Guru

343 Posts

Posted - 2005-07-19 : 04:14:55
I'm restoring a database from another server to a upgraded server, using Disk file. After the database is restored, its "public" role of the database is restored as well, and filled with many users that do not exist on the upgrade box. I could not remove these entries with sp_dropuser or anything else. sp_helpuser on the database only reports these entries as "NULL", but selecting "Properties" in
the public role in Enterprise Manager would show login names for these entries. If I create any new user on the system with the same name as one of those entries, error is generate that 'User already exists in that Database.




mk_garg

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2005-07-19 : 06:07:21
after restore db, reconcile the orphaned users using sp_change_users_login, then sp_dropuser

or

have you tried, sp_droprolemember, then sp_dropuser?

--------------------
keeping it simple...
Go to Top of Page

mk_garg20
Constraint Violating Yak Guru

343 Posts

Posted - 2005-07-19 : 06:55:22
Hi,


I tried sp_dropuser. It was not working.

Regarding sp_droprolemember, BOL says "Users cannot be removed from the public role"

mk_garg
Go to Top of Page

mk_garg20
Constraint Violating Yak Guru

343 Posts

Posted - 2005-07-20 : 18:35:31
sp_revokedbaccess worked for me.

cheers


mk_garg
Go to Top of Page
   

- Advertisement -