July 3, 2002 at 3:56 pm
I know that there is a way to drop a user from one database but not from another. Does sp_drop user do that? To be more specific, I want to drop all users (except for dbo) from one database but not from all others. Is that possible.
July 3, 2002 at 5:48 pm
sp_dropuser will drop for a user account for the current database only. You could write a cursor which retrieves a list of all user accounts except dbo and then use dynamic SQL to execute the sp_dropuser statement.
K. Brian Kelley
http://www.sqlservercentral.com/columnists/bkelley/
K. Brian Kelley
@kbriankelley
July 4, 2002 at 5:11 am
For what its worth, MS recommends using sp_revokedbaccess instead of sp_dropuser, though if you check the code, sp_dropuser just calls sp_revokedbaccess!
Andy
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply