Delicious LinkedIn Facebook Twitter RSS Feed

: How to delete History of SQL Server (SSMS).





Problem: How to delete History of SQL server (SSMS)
Once we connect to several SQL Server instances. Once connected successfully, this server history is shown in the drop down list as shown below.
 In some cases we might have similar names for servers as such as using; P for production, D for Development, U for UAT and T for Test environments. Because of this there may be a chance that we connect to the wrong server. Also, there may be times when we connect to servers infrequently or a server may go away, but the name is still in the list. For these types of scenarios we want to clear the server list and only show servers we really need to work with, but unfortunately there is not an option within SSMS.
We have to follow the Easy Steps
·         If you are using SQL 2008, document the required options which you have set, so you can reconfigure after renaming/deleting the file
For SQL 2008, the file location,
            C:\Documents and Settings\<USER>\Application Data\Microsoft\Microsoft SQL Server\100\Tools\Shell\SqlStudio.bin

·         For SQL 2005, delete the file:
C:\Documents and Settings\<USER>\Application Data\Microsoft\Microsoft SQL Server\90\Tools\Shell\mru.dat

  • 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



Solution
Unfortunately there is not a simple solution to clear the history from within SSMS, but following the below steps for SQL 2005 and SQL 2008 you can clear the history.
Step 1
Make sure that the "SQL Server Management Studio" is not opened.

Step 2
Open a run box as shown below and enter:

For SQL Server 2005
%APPDATA%\Microsoft\Microsoft SQL Server\90\Tools\Shell\

For SQL Server 2008
%APPDATA%\Microsoft\Microsoft SQL Server\100\Tools\Shell\


Step 3
The above command will open the application data folder of your logged in account and then do the following.
SQL Server 2005
Search for file mru.dat and you can either rename or delete this file.
SQL Server 2008
Search for file SqlStudio.bin and you can either rename or delete this file.
Note that if you use Run As… to open SSMS, you have to change the profile name in the path to match the Windows account and delete the appropriate file.


Step 4
Once you renamed or deleted the mru.dat or SqlStudio.bin file and start SSMS again you will not see any recent servers in the list



For SQL 2008, note that once you delete the SqlStudio.bin file, you will lose any configured SSMS settings, so you will have to reconfigure the settings.
Do this go to Tools -> Options and re-configure as needed.



Try this once You install 2 or More Instances. 








0 comments:

Post a Comment