JMax2012
JMax2012

Reputation: 373

SQL Server Management Studio - Server Names Disappeared

The first dialog box you get when opening SSMS (mine is 2008 R2) allows you to choose which server you want to connect to.

I had at least six servers in that list, including a local server called something like MYPC/SQLSERVEREXPRESS

Windows Updates ran last night and rebooted my machine, and now my SSMS list of servers is gone. I can select (local) or (browse for more)

What happened to my previously saved servers and their saved login info?

Upvotes: 10

Views: 22495

Answers (2)

Andrei Rantsevich
Andrei Rantsevich

Reputation: 2945

As I understand, you want to retrieve your credentials from that file.

There is a way to restore your passwords, if you still have sqlstudio.bin file and you can see "password" entries there.

First, some theory: When SSMS saves connection object it encrypts the password using some encryprion method, that is BOUND to your windows login. If you try to copy the sqlstudio.bin to other machine/user profile, passwords will not be decrypted. So it is important that you do all actions under same windows account, that you have used then sqlstudio.bin was generated. I can not tell you, if you can directly manipulate sqlstudio.bin - I suppose there are some checksums there which will prohibit direct manipulation, but there is another way.

I know the information I written above, because I develop myself an add-in for SSMS - SSMSBoost. I have implemented there the logic to manage preferred connections (so that you actually will not need standard dialogue anymore). I use exactly the same SSMS objects to store connections and serialize then into XML, so it is easier to manipulate.The picture below shows contents of sqlstudio.bin and SSMSBoostSettings.xml for the same connections. You can recognize, that username and password binary data are the same. So, to restore your password you have to:

  1. install ssmsboost

  2. add preferred connection to ANY database with sql server security

  3. open SSMSBoostSettings.xml (you will see the path to that file in settings dialogue, after you have saved settings. Just save, close and re-open it. Path is displayed at the bottom)

  4. Close SSMS, open sqlstudio.bin and ssmsboostsettings.xml in editor

  5. modify entry in ssmsboostsettings.xml - enter data of your server from sqlstudio.bin - adress, database name, username. Carefully copy password data.

  6. save xml and open SSMS - SSMSBoost will now show your connection in preferred connections and you will be able to connect to database. (see second picture)

retrieve password ssms connection enter image description here

Upvotes: 1

Debura
Debura

Reputation: 509

The file that stores these for 2008 is found at c:\%UserProfile%\Microsoft\Microsoft SQL Server\100\Tools\Shell\SqlStudio.bin

My guess is that it is still there, but was overwritten by one of your updates, you can check it to see when it was last modified.

You should make use of registered servers and export the file to save time if this happens again.

Upvotes: 1

Related Questions