Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove cached server names from the Connect to Server dialog?

Or, to put it another way, where is SqlStudio.bin for SQL Server 2012? It doesn't seem to be in the place that would be expected by looking at this other SO question.

like image 252
Damian Powell Avatar asked Jun 12 '12 09:06

Damian Powell


People also ask

How do I remove my old server name?

Open the Connect to Server dialog (File->Connect Object Explorer, Object Explorer->Connect->Database Engine, etc.). Click on the Server Name field drop down list's down arrow. Hover over the items you want to remove. Press the delete (DEL) key on your keyboard.

How do I clear my SSMS cache?

To clear SQL Server's cache, run DBCC DROPCLEANBUFFERS , which clears all data from the cache. Then run DBCC FREEPROCCACHE , which clears the stored procedure cache.


2 Answers

As of SQL Server 2012 you no longer have to go through the hassle of deleting the bin file (which causes other side effects). You should be able to press the Delete key within the MRU list of the Server Name dropdown in the Connect to Server dialog. This is documented in this Connect item and this blog post.

To be clear, since a couple of people seemed to have trouble with this for months: You need to click on the Server name: dropdown, and down-arrow or hover with your mouse until the server you want to remove is selected, and then press Delete. In this screen shot, I'm going to press Delete now, and it will remove the server ADMIN:SHELDON\SQL2014 from my MRU list. Note that because I merely hovered with my mouse, this is not even the server that is showing in the Server name: text box.

enter image description here

Note that if you have multiple entries for a single server name (e.g. one with Windows and one with SQL Auth), you won't be able to tell which one you're deleting.

like image 169
Aaron Bertrand Avatar answered Sep 20 '22 05:09

Aaron Bertrand


Found it!

C:\Users\%username%\AppData\Roaming\Microsoft\SQL Server Management Studio\11.0\SqlStudio.bin 

So the answer is as before: delete the file, or use some nifty PowerShell magic to edit it.

like image 26
Damian Powell Avatar answered Sep 18 '22 05:09

Damian Powell