Re: User Termination
- From: "Agoo" <agoo@xxxxxx>
- Date: Mon, 18 Dec 2006 11:53:01 -0400
Thanks Hari,
I guess I was looking to create a stored proc that would do all this. So
all I would need to do is something line this
exec dropandremove username
and that would pass my parameter and remove all db access as well as the
login. The reason for this is if a user no longer works for the company, I
have to search through a couple dozen servers to see where that user had
access, and then remove it. So the plan is to drop the stored proc on
multiple servers, then just run the drop. Viola, user maintenance is
automated. But yes I agree with you, it is best done as a manual task.
Just too many servers and not enough DBA.
Thanks,
Aaron
"Hari Prasad" <hari_prasad_k@xxxxxxxxxxx> wrote in message
news:eSo0rKmHHHA.3616@xxxxxxxxxxxxxxxxxxxxxxx
Hello,
I prefer to do this manually; basically you need to transfer the ownership
using sp_changeobjectowner if you have this user owns any objects.
1. Execute sp_helplogins <Login_Name> to get all the database user mapping
in different
2. Go to each database and drop the user sp_dropUser <username>
3. Finally drop the login using sp_droplogin <loginname>
Thanks
Hari
"Agoo" <agoo@xxxxxx> wrote in message
news:eHG3SFiHHHA.4688@xxxxxxxxxxxxxxxxxxxxxxx
Hi All,
I'm a newby to SQL and I would like to create a SQL stored proc to drop a
given user from all databases, and the drop the login.
So if any given server has 10 or 12 databases, I was hoping the proc
would loop through whatever the databases are : Select name from
master..sysdatabases and drop the user if it exists. Then finally drop
the login from the server.
Anybody got something like this already? Much appreciated.
-Aaron
Agoo@xxxxxx
.
- References:
- User Termination
- From: Agoo
- Re: User Termination
- From: Hari Prasad
- User Termination
- Prev by Date: Re: SQL 2000 securing records...
- Next by Date: Re: Securing a SQL Server Database
- Previous by thread: Re: User Termination
- Next by thread: Re: How do determine who is the owner of an object?
- Index(es):
Relevant Pages
|
|