Monday, March 26, 2012

Killing a user/login

I have a user that I need to get rid of in a database. I tried to us
sp_droplogin but got an error regarding the user, I used sp_user and
then was told that the user owns objects and cannot be dropped.
This user has over 300 objects encompassing stored procedures, views,
tables and so on -- and I don't have enterprise manager. Is there a
quick and clean way of just zapping the user and everything it owns?!
Essentially I need to create a script to send to somebody to do this --
their user and objects are all out of wack.
JamesIt's not really clear what you are attempting to accomplish.
Removing a user is easy, removing all objects owned by that user isn't very
difficult either.
BUT, do you really want the objects to be DELETED from the database?
OR do you really want the user to be removed and the objects kept -but just
assigned to other ownership?
--
Arnie Rowland, Ph.D.
Westwood Consulting, Inc
Most good judgment comes from experience.
Most experience comes from bad judgment.
- Anonymous
<starritt@.gmail.com> wrote in message
news:1158605443.645160.227840@.e3g2000cwe.googlegroups.com...
>I have a user that I need to get rid of in a database. I tried to us
> sp_droplogin but got an error regarding the user, I used sp_user and
> then was told that the user owns objects and cannot be dropped.
> This user has over 300 objects encompassing stored procedures, views,
> tables and so on -- and I don't have enterprise manager. Is there a
> quick and clean way of just zapping the user and everything it owns?!
> Essentially I need to create a script to send to somebody to do this --
> their user and objects are all out of wack.
> James
>

No comments:

Post a Comment