Re: User Termination
- From: "Hari Prasad" <hari_prasad_k@xxxxxxxxxxx>
- Date: Tue, 12 Dec 2006 20:59:16 -0600
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
.
- Follow-Ups:
- Re: User Termination
- From: Agoo
- Re: User Termination
- References:
- User Termination
- From: Agoo
- User Termination
- Prev by Date: Re: Deny Create Database in SQL Server 2000
- Next by Date: SQL Server and PGP
- Previous by thread: User Termination
- Next by thread: Re: User Termination
- Index(es):
Relevant Pages
|
|