Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 643
JMax2012 Avatar asked Oct 25 '12 13:10

JMax2012


People also ask

Why does SQL Server Management Studio not show server name?

Open up SQL Server Configuration Manager (search for it in the Start menu). Click on SQL Server Services . The instance name of SQL Server is in parenthesis inline with SQL Server service. If it says MSSQLSERVER, then it's the default instance.

How do I get a list of SQL Server?

Use SQL Server Management StudioIn Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance. To see a list of all databases on the instance, expand Databases.


2 Answers

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.

like image 161
Debura Avatar answered Oct 22 '22 05:10

Debura


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 connectionenter image description here

like image 23
Andrei Rantsevich Avatar answered Oct 22 '22 06:10

Andrei Rantsevich