How To Set Up Database Password

  • Hi,

    i am using sql server 2008. How can i lock my database, so that every time i open it from sql server management studio, it asks for a password.

  • It already asks for a password whenever you connect using SQL Server authentication.

    When you connect using Windows authentication, it asks for a password at logon.

    Isn't it secure enough for you?

    -- Gianluca Sartori

  • No,

    actually what i want is to set a password on database when i open it from management studio.

  • That's not how SQL Server works. You enter passwords to connect to the instance and then the login's permissions determine whether or not it can access the databases.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • This is not how it works. You use password to authenticate the login. After the login was authenticated, it can use the permissions that he got. If you don't want a login to work with your database then don't give him permissions to use this database (e.g. don't map his login to a user in the database and don't enable the user guest on this database).

    Adi

    --------------------------------------------------------------
    To know how to ask questions and increase the chances of getting asnwers:
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

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

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