Setting default database ?

  • Anyone know how can I set the default database  so that Management studio will default to a particular database when the connection with the server is established ? "Help" doesn't !

     

    David Bytheway

  • The default database is based on your login's default database setting on the SQL Server. For SQL Server 2005, you can set the default database by:

    ALTER LOGIN <loginname>

    WITH DEFAULT_DATABASE = <database>

    Of course, if you're login is getting access via a Windows group, you have two options:

    1) Changing the default database for everyone in that group

    2) Explicitly creating a login for your user account and setting the default database (this can be done in the CREATE LOGIN statement itself)

    K. Brian Kelley
    @kbriankelley

Viewing 2 posts - 1 through 1 (of 1 total)

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