locked
Deleting User Accounts RRS feed

  • Question

  • There appears to be an issue where when I delete a user account in SQL Server the account is "cached."  I have to restart SQL Server for the account to totally go away.  Am I doing something wrong?

    JamesNT


    ATTENTION MODERATORS: I do indeed mark responses as answers after I have had time to test said response and verify that it works. Please do NOT assume you speak on my behalf by marking responses to my questions as answers. Mass-proposing responses as answers gets on my nerves, too. Thank you.

    Wednesday, May 13, 2015 6:23 PM

Answers

  • !)  USE [master]

    DROP LOGIN [singletable]
    GO

    see successful message

    2)

    SELECT name AS Login_Name, type_desc AS Account_Type
    FROM sys.server_principals 
    WHERE TYPE IN ('U', 'S', 'G')
    and name not like '%##%'
    ORDER BY name, type_desc

    check account is deleted.

    • Marked as answer by JamesNT Sunday, May 17, 2015 12:43 PM
    Thursday, May 14, 2015 12:31 AM

All replies

  • How do you determine that the "user account" is still there. Also, are we talking about the login or the user?

    Tibor Karaszi, SQL Server MVP | web | blog

    Wednesday, May 13, 2015 7:34 PM
  • There appears to be an issue where when I delete a user account in SQL Server the account is "cached."  I have to restart SQL Server for the account to totally go away.  Am I doing something wrong?

    JamesNT


    ATTENTION MODERATORS: I do indeed mark responses as answers after I have had time to test said response and verify that it works. Please do NOT assume you speak on my behalf by marking responses to my questions as answers. Mass-proposing responses as answers gets on my nerves, too. Thank you.

    typically, when you delete a user/login, you need to refresh the node(login\users) or a general refresh to not see it any more(depending on how you deleted the user\login)

    what is excatly you mean by caching?


    Hope it Helps!!

    • Proposed as answer by Cheer08 Thursday, May 14, 2015 7:59 AM
    • Unproposed as answer by JamesNT Sunday, May 17, 2015 12:43 PM
    Wednesday, May 13, 2015 10:18 PM
  • !)  USE [master]

    DROP LOGIN [singletable]
    GO

    see successful message

    2)

    SELECT name AS Login_Name, type_desc AS Account_Type
    FROM sys.server_principals 
    WHERE TYPE IN ('U', 'S', 'G')
    and name not like '%##%'
    ORDER BY name, type_desc

    check account is deleted.

    • Marked as answer by JamesNT Sunday, May 17, 2015 12:43 PM
    Thursday, May 14, 2015 12:31 AM