[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.sqlserver.programming

get DB access for an account?

lynn

3/29/2007 10:30:00 PM

Hi,

I would like to design a procedure to dropuser and droplogin in database for
terminated employee. Is there any exist script to use? Or How can I got the
Database Access for an account without go thorugh each user database?

Thank you for you help.
--
Best Regards,

Lynn
2 Answers

Immy

3/30/2007 1:34:00 PM

0

sp_helplogins 'Username'

"Lynn" <Lynn@discussions.microsoft.com> wrote in message
news:756804AE-83E7-46BB-AABE-667844103DCC@microsoft.com...
> Hi,
>
> I would like to design a procedure to dropuser and droplogin in database
> for
> terminated employee. Is there any exist script to use? Or How can I got
> the
> Database Access for an account without go thorugh each user database?
>
> Thank you for you help.
> --
> Best Regards,
>
> Lynn


lynn

3/30/2007 11:08:00 PM

0

Thank you. The SP is very helpful. I create an SP to dropuser in each
database and then drop login for a set of user. But, somehow I have problem
to drop login for the user which is using window account. Even I manually
run the following connect by either use Master db or user's default DB. I
still get "The login 'XXX\abc222' does not exist." message.

exec sp_droplogin 'XXX\abc222';

What's the problem? Thank you for your help.

--
Best Regards,

Lynn


"Immy" wrote:

> sp_helplogins 'Username'
>
> "Lynn" <Lynn@discussions.microsoft.com> wrote in message
> news:756804AE-83E7-46BB-AABE-667844103DCC@microsoft.com...
> > Hi,
> >
> > I would like to design a procedure to dropuser and droplogin in database
> > for
> > terminated employee. Is there any exist script to use? Or How can I got
> > the
> > Database Access for an account without go thorugh each user database?
> >
> > Thank you for you help.
> > --
> > Best Regards,
> >
> > Lynn
>
>
>