Delete a login

  • How do I delete a login when he's logged into the server?

    I keep getting this message when I try to drop him--

    'Could not drop login'xyz' as the user is logged in'

    Any help?

  • Here's what I'd do, but it's cumbersome - hopefully someone else can chime in with a better answer.

    1) Disable the login: ALTER LOGIN <login> DISABLE

    This will ensure the login can't connect again, but it won't kill any current connections. Thus the cumbersome part:

    2) Find all the login's connections, and manually kill them. You can use SSMS' Activity Monitor, expand the Processes section, filter the Login column to show only that login, then go down the list and right click -> kill each process.

    Once that's done, you should be able to drop the login.

    ______
    Twitter: @Control_Group

  • Thanks, it worked...But I was wondering if there is an easy way out?

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply