Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove "Server name" items from history of SQL Server Management Studio

Tags:

ssms

People also ask

How do I delete a SQL Server Management Studio name?

To do this in early versions of SSMS, you needed to locate the SqlStudio. bin file from the Documents and Settings area in your user profile. Fortunately, that's no longer required. All you need to do is to open this dialog, arrow down to the ones that you want to remove, and hit the Delete key.

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.


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.

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.


Here is simpliest way to clear items from this list.

  1. Open the Microsoft SQL Server Management Studio (SSMS) version you want to affect.
  2. Open the Connect to Server dialog (File->Connect Object Explorer, Object Explorer-> Connect-> Database Engine, etc).
  3. Click on the Server Name field drop down list’s down arrow.
  4. Hover over the items you want to remove.
  5. Press the delete (DEL) key on your keyboard.

there we go.


For SQL 2005, delete the file:

C:\Documents and Settings\<USER>\Application Data\Microsoft\Microsoft SQL Server\90\Tools\Shell\mru.dat

For SQL 2008, the file location, format and name changed:

C:\Documents and Settings\<USER>\Application Data\Microsoft\Microsoft SQL Server\100\Tools\Shell\SqlStudio.bin

How to clear the list:

  1. Shut down all instances of SSMS
  2. Delete/Rename the file
  3. Open SSMS

This request is registered on Microsoft Connect


Over on this duplicate question @arcticdev posted some code that will get rid of individual entries (as opposed to all entries being delete the bin file). I have wrapped it in a very ugly UI and put it here: http://ssmsmru.codeplex.com/


For SQL Server 2012 Management Studio, this file has moved. It is now located at:

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

In Windows Server 2008 standard with SQL Express 2008, the "SqlStudio.bin" file lives here:

%UserProfile%\Microsoft\Microsoft SQL Server\100\Tools\Shell\