SqlServer 2005 Login Management

Last Post 27 Nov 2006 08:54 AM by rhuyck. 1 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
rhuyck
New Member
New Member

--
26 Nov 2006 06:57 AM
We have an application that manages security at the application level. To facilitate this we have created an Admin Tool that manages users and security. In 2000 if we removed a user from the database and then dropped the login. if that user was a member of another database it would throw an error and we would capture this and report it to the Administrator that the user was dropped from the database but the login could not be dropped.

In 2005, it just drops the login (using both the Drop Login command and the sp_droplogin). This can create orphane users in other databases in the same instance. Is there a way to avoid this?

Thanks in advance for any help
rhuyck
New Member
New Member

--
27 Nov 2006 08:54 AM
I can see how this would help interactively as it produces two reports. But how do I use it programmatically to test before I drop the login. @@ERROR will produce a success whether the results are null or not.
I just want to be able to test in a Stored Procedure whether a login name is a member of any database before dropping the login.

Can I still use sp_helplogins to give a yes or no answer to that question?

Thanks


Acceptable Use Policy
---