locked
Remove logins RRS feed

  • Question

  • Hi,

    1. Before removing the logins from the server, we should remove users associated with the logins.

          How can i remove users associated with that logins?

    2. I have DR server with logshipping, if I want to remove users associated with the DB, is it possible?

    Please help.

    Thanks


    Shashikala

    Friday, May 9, 2014 10:57 AM

Answers

  • I create one login and mapped into one database, is it create user automaticaly for that database.

    When I search with the query select * from sys.sysusers, I am not able to see this username in the lis


    Yes it does with same name.You can check in database security ..users.

    Please dont use sys.sysusers its not supported and is there just for backward compatibility.Instead you shoud use sys.database_principal .

    Please run below query in database for which you are looking user

    use db_name
    go
    select * from sys.database_principals where type in('S','U')


    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers


    My TechNet Wiki Articles

    • Marked as answer by bhat BK Friday, May 9, 2014 12:36 PM
    Friday, May 9, 2014 11:39 AM

All replies

  • you can use DROP USER command for that

    http://technet.microsoft.com/en-us/library/ms189438.aspx


    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

    Friday, May 9, 2014 11:02 AM
  • 2. I have DR server with logshipping, if I want to remove users associated with the DB, is it possible?

    Hi,

    I guess you are talking about orphaned users, why not create logins and map it to users. Is there any issue with that why do you want to remove users.It wont be of any use unless you have a login mapped to it.


    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers


    My TechNet Wiki Articles

    Friday, May 9, 2014 11:04 AM
  • I create one login and mapped into one database, is it create user automaticaly for that database.

    When I search with the query select * from sys.sysusers, I am not able to see this username in the list.


    Shashikala

    Friday, May 9, 2014 11:11 AM
  • I create one login and mapped into one database, is it create user automaticaly for that database.

    When I search with the query select * from sys.sysusers, I am not able to see this username in the lis


    Yes it does with same name.You can check in database security ..users.

    Please dont use sys.sysusers its not supported and is there just for backward compatibility.Instead you shoud use sys.database_principal .

    Please run below query in database for which you are looking user

    use db_name
    go
    select * from sys.database_principals where type in('S','U')


    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers


    My TechNet Wiki Articles

    • Marked as answer by bhat BK Friday, May 9, 2014 12:36 PM
    Friday, May 9, 2014 11:39 AM