drop sql login and related database users altogether
From: Nitin Rana (Nitin_Rana_at_ibi.com)
Date: 07/12/04
- Next message: Frank: "Re: SELECT . . . ORDER BY - SQL 2000 vs. JET 4"
- Previous message: Nitin Rana: "Decrypt SQL Proc"
- In reply to: joe: "drop sql login and related database users altogether"
- Messages sorted by: [ date ] [ thread ]
Date: Mon, 12 Jul 2004 15:47:53 -0700
Hi,
This is what you need to do.
Dump the result set of this query in a temp table or set a
cursor for read only.
and then loop thru it. Of course you wanna make sure that
login name is not SA.
select name , suser_sname(sid) from
master.dbo.sysdatabases
WHERE suser_sname(sid) = @InputLogin
-Nitin
>-----Original Message-----
>Hi, I¡¯m wondering if there is procedure which is based
on SQL login to
>return all database names for which user is owner.
>then drop user from each database, and finally drop sql
login.
>
>
>
>
>
>
>.
>
- Next message: Frank: "Re: SELECT . . . ORDER BY - SQL 2000 vs. JET 4"
- Previous message: Nitin Rana: "Decrypt SQL Proc"
- In reply to: joe: "drop sql login and related database users altogether"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|