Delete User

  • Trying to delete a user. I use sp_revokedbaccess and I see the user removed from the user database. However, the user is still visible in the Logins folder under security. I'd like to be able to do this with TSQL, not Enterprise Manager.

    Thanks...Nali

  • Hello,

    Do Actions ->Refresh.

    Sometimes it does not help too with logins and users. Then I disconnect in Enterprise manager and re-connect. This is a matter of refreshing information for Enterprise Manager, not the issue that the login was not deleted.

    Regards,Yelena Varsha

  • I'm afraid that did not do it. This user refuses to go away!

  • Use sp_revokelogin for NT authenticated logins, or sp_droplogin for SQL logins.

  • Does he/she/it owns objects? Were there any error messages? Did you revoke access in the same database on the same server as you are watching it?

    And just noticed: you revoked access to the user in the database, did it disappear from Users in the database? It should not have disappeared from Logins because you did not revoke the login, just database user. Use sp_revokelogin for logins

    Regards,Yelena Varsha

  • Let me clear up a misunderstanding.......

    sp_revokedbaccess just removes the user from the DATABASE, not from SQL Server.

    sp_droplogin removes them from SQL Server.

    You need to use sp_droplogin.

    However, this WILL FAIL if the user is the owner of any object (table/database) as Yelena pointed out.

    -SQLBill

  • sp_droplogin is to drop SQL Server Standard Logins

    sp_revokelogin is to revoke access to SQL Server from Windows users and group.

    Use the appropriate one for your login type.

    Regards,Yelena Varsha

  • sp_revokelogin  worked. Thank you!

Viewing 8 posts - 1 through 7 (of 7 total)

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