My boss couldn’t login using SSMS after he told me to drop a database no longer in use. It was easy to fix. Think about it – he could login before the database was dropped, but not after. It was his default database. When your default database does not exist or otherwise isn’t valid, your login fails. I reset his default database to a valid database and he could login. But he wanted to know what he could have done in case I wasn’t around.
I thought of sqlcmd, but knew there had to be other workarounds. Brian Kelley came to my rescue and reminded me about the Options button on the SSMS Connect to Server dialog box. Clicking the Options button exposes additional options spread across three different tabs. Take a close look at the Connect to database dropdown list on the Connection Properties tab.
Select the <Browse server…> choice and you’ll see this:
Click Yes and you’ll see something similar to the following:
You can select which database you’ll connect to. My boss could have done this to successfully connect without getting my help. You can also switch the network protocol from TCP/IP to Named Pipes. Or check the Use custom color checkbox (SSMS 2008) and change the color of your connection. I’ve been using that feature to help keep me notice whether I’m on a test database or a production database. I use red for production databases, yellow for staging, green for test.