SQL SERVER – Connecting Specific Database on Starting SSMS

In today’s blog post we are going to learn how to connect specific database directly when we start SQL Server Management Studio. Honestly, this is a very simple process, but I have seen quite a few DBA still unaware of this feature.

I have seen DBAs directly connecting to master database, which has eventually lead them to create objects which does not belong to master database. If you do not believe me, you should open your master database and see that there may be quite a few objects which are not related to that database at all.

Let us learn how we can configure our SQL Server Management Studio (SSMS) to connect to specific database when we start it off.

First open SSMS Connect to Server Screen –

SQL SERVER - Connecting Specific Database on Starting SSMS ssmsconnect1

Next Select Options >>

SQL SERVER - Connecting Specific Database on Starting SSMS ssmsconnect2

Right after that click on the drop down “Connect to Database

SQL SERVER - Connecting Specific Database on Starting SSMS ssmsconnect3

Over here – click on “Browse Server…” and next it will bring another popup where it will say, that it may take some moments. Click Yes over here.

SQL SERVER - Connecting Specific Database on Starting SSMS ssmsconnect4

Finally, it will bring up the Browse Server for Database Screen.

SQL SERVER - Connecting Specific Database on Starting SSMS ssmsconnect5

Select your preferred database and click on OK.

That’s it. You are done. Now you will be connected to your preferred database when you connect to SQL Server Management Studio (SSMS).

Reference: Pinal Dave (https://blog.sqlauthority.com)

Previous Post
SQL SERVER – The SaveToSQLServer Method has Encountered OLE DB Error Code 0x80040E4D
Next Post
YCSB Benchmark and Latest Evaluation With NuoDB

Related Posts

No results found.

6 Comments. Leave new

  • Adriana Milcov
    October 5, 2017 2:15 pm

    Is there any way of coming back to the default settings on this option “Connect to database:” .
    I’ve tried “Reset All” button but it doesn’t work on this option, it still sowh me the last db selected.

  • Hi Pinal,
    I installed MS SQL server 2016 in windows 10 machine. Afterwards, I also changed machine name and new local admin account name but now I am having a problem to connect to existing server instance, could you help to change my MS SQL server settings?

  • The danger of this is when the database you are connecting to is unavailable. You need to remember to go back and change the default connection again otherwise you can’t connect to the server.

  • Wonderful Article. I love reading your articles.

    This one was simple tip but quite amazing. Thanks for this!

  • Thank you. This is exactly what I was looking for!

  • Pinal, thank you for sharing your knowledge and experience; you articles are always very helpful.

    Regarding this article…I am using a shared SQL server that includes many databases and only need access to a few. I thought that I could use your method to only show a specific database when I log in but the entire library still appears when I connect. I also reviewed Microsoft’s documentation for SSMS & Azure and it sounds like that’s how it should work. I’ve tried both SSMS 2016 & 2019 and both show all of the databases on the server. But, if I use Azure Data Studio, it works as stated and only connects to the database specified.

    Are there any other parameters on SSMS or MSSQL that need to be changed to make this work or is this a known issue?


Leave a Reply