how to default to a DB when opening SSMS

  • When I open SSMS and login through Authentication to a server, is there a way to make it default to a particular database other than 'master'.?

    Dan

  • First thought is change the default database for your login to something other than master.. Try that..

    CEWII

  • You could use the command line switches of SSMS/SQLWB

    Ssms.exe|SQLWB.exe [-S servername] [-d databasename] [-U login] [-P password] [-E] [-nosplash] [file_name[,file_name]]

    -S [servername] server name to connect to

    -d [databasename] nome of the database

    -U [loginname] SQL Server login

    -P [password] SQL Server login's password

    -E Use Windows Authetication

    [file_name] SQL file to open

    -- Gianluca Sartori

  • CEWII

    I login in through Win Authen; so I do not see my login in under Security->Logins

    Dan

  • Gianluca Sartori

    That worked. thx.

    Dan

  • repent_kog_is_near (10/2/2009)


    CEWII

    I login in through Win Authen; so I do not see my login in under Security->Logins

    Dan

    Then you would have to change it for the whole group that is allowing you in.. The other poster's idea is better in that case..

    CEWII

  • CEWII

    Thanks very much for your thought there. In the Servers where I have specific login under security, I will use your method.

    Dan.

  • Another option would be to set the database you want to connect to in the Registered Servers portion of SSMS. Then, every time you want to open a new query - right click on the registered server and select new query.

    If you double-click on the entry in registered servers, then select that server in Object Explorer - new query windows will also open up in the defined database.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

  • Ahh! I have never used registered server window before. Now, I see I have missed a good functionality of SSMS all this while.

    thanks Jeff.

  • You are welcome - glad I could help.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

Viewing 10 posts - 1 through 9 (of 9 total)

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