Creating a user in QA with a default database

  • I would like to create a user and grant this person a default database each time he/she logs in(using query analyzer).I could have probably looked on the wrong page of books online and would appreciate your help

    Thanks

    Michael

  • --Check BOL. Use Index tab. Look for phrase

    user accounts

    --then choose

    described

    --You will find exactly what you are needing.



    Michelle

  • To add a SQL Server login, refer to:

    sp_addlogin [ @loginame = ] 'login'

        [ , [ @passwd = ] 'password' ]

        [ , [ @defdb = ] 'database' ]

        [ , [ @deflanguage = ] 'language' ]

        [ , [ @sid = ] sid ]

        [ , [ @encryptopt = ] 'encryption_option' ]

     

    To add a Windows Login (integrated security), refer to:

    sp_grantlogin [@loginame =] 'login'

    and

    sp_defaultdb [ @loginame = ] 'login' ,  [ @defdb = ] 'database'

  • You can alos use Enterprise Manager to set the default database:

    1.  Expand the SQL Server Group in the left pannel.

    2.  Expand the Server

    3.  Expand Security

    4.  Select Logins (also in the left pannel)

    5.  In the right pannel, right click on the user's account and select Properties.

    6.  At the bottom to the Properties dialog box select the database you want the default to be.

     

  • Got the needed help .Thank you all for the great responses

     

    Mike

Viewing 5 posts - 1 through 4 (of 4 total)

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