Adding users to SQL Security on new database in SQL 2008

Answered Adding users to SQL Security on new database in SQL 2008

  • Wednesday, August 01, 2012 5:16 PM
     
     
    I have created a new database in SQL 2008. When I go to the Security tab\Users and then select New User, the user I am expecting does not show up. How do I get users to show up so I can select the one I want? The one's that show up are not the one I need. How do I add a user for selection?

All Replies

  • Wednesday, August 01, 2012 5:25 PM
    Answerer
     
     
    When I go to the Security tab\Users and then select New User, the user I am expecting does not show up.

    Then the user don't have a server login. In SSMS open node "Security" => "Logins" and add the user first there, then you can add it as database user.

    Olaf Helper
    * cogito ergo sum * errare humanum est * quote erat demonstrandum *
    Wenn ich denke, ist das ein Fehler und das beweise ich täglich
    Blog Xing

  • Wednesday, August 01, 2012 5:25 PM
     
     Answered

    Hi,

    If you have a desired login existed on the server, simply map it. for example as below

    USE [satish]

    GO

    CREATE USER [test1] FOR LOGIN [test1]

    GO

    USE [satish]

    GO

    EXEC sp_addrolemember N'ROLE', N'test1'

    GO

    thanks


    Thanks, Satish Kumar. Please mark as this post as answered if my anser helps you to resolves your issue :)