SQL SERVER – Clear Drop Down List of Recent Connection From SQL Server Management Studio

Quite often it happens that SQL Server Management Studio’s Dropdown box is cluttered with many different SQL Server’s name. Sometime it contains the name of the server which does not exist or developer does not have access to it. It is very easy to clean the list and start over.

Delete mru.dat file from following location.

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

If you can not find mru.dat at above location look for mru.dat in following folder.
C:\Documents and Settings\[user]\Application Data\Microsoft\Microsoft SQL Server\90\Tools\ShellSEM\mru.dat

For SQL Server 2008:
C:\Documents and Settings\<user>\Application Data\Microsoft\Microsoft SQL Server\100\Tools\Shell\mru.dat

If you can not find mru.dat at above location look for mru.dat in following folder.
C:\Documents and Settings\[user]\Application Data\Microsoft\Microsoft SQL Server\100\Tools\ShellSEM\mru.dat

If you are using VISTA OS instead of XP OS. Replace C:\Documents and Settings\[user]\Application Data\Microsoft\ with
C:\Users\\AppData\Roaming\Microsoft\ and it should work.

Make sure to take note down any IP address of SQL Server you may need in future.

Watch the video on the same subject:

Reference : Pinal Dave (http://www.SQLAuthority.com)

29 thoughts on “SQL SERVER – Clear Drop Down List of Recent Connection From SQL Server Management Studio

  1. Just want to add 2 cents to the article.

    You might want to keep your folder options, to view show hidden folders, if not then you will not be able to see some folders , like Application Data folder.

    Thanks, Very useful information.

    Like

  2. Re: Vista OS & SQL 08

    For me it was a different file:
    C:\Users\[user]\AppData\Roaming\Microsoft\Microsoft SQL Server\100\Tools\Shell\SqlStudio.bin

    rename the above file and it does the trick.

    Like

  3. There are problems related to removing the SQLStudio.bin file as is contains a number of other values – removal is not supported by microsoft and a number of other posts relating to this subject describe that this is a poor design issue in that it does not allow easy management of the list – as a result and to prevent the unnecessary complications I suggest that you create a new user, log in on that account and open SSMS – it will save a new instance of all the setting, files etc. and once you have successfully logged on the default sql server (using that account) – copy the file created in the new account over your original log out – job done

    Like

  4. I found the removal of SQLStudio.bin to accomplish the goal of clearing the list. However, instead of removing it, I just appended a .BACKUP extension to that file.

    Upon opening SQL Management Studio 2008 on Vista x64, it simply recreated the file and the list was cleared.

    There do not appear to be any problems, but that doens’t mean there won’t be.

    I’m not sure what problems Mike Watkins was refering to, but I have not come accross any yet. Anyway, just wanted to let you guys (and anyone reading this) know.

    Like

  5. Pingback: SQLAuthority News – Wireless Router Security and Attached Devices – Complex Password Journey to SQL Authority with Pinal Dave

  6. Hi, I understand there are ways to clear the list but I wish to increase the max limit of the MRU list (to something about a thousand) as I connect to a lot of servers everyday and have to type in the credentials manually. Is there a wasy to do this?

    Like

  7. This is really a combination of the OS and SSMS file placement.
    I’ve outlined it here.
    Before you delete any file be aware that this file is the configuration file for SQL Server Management Studio. Any customizations you have done will be lost.

    To clear the connections list in SQL Server Management Studio and reset it to default settings:

    Close SQL Server Management Studio.
    Delete or rename mru.dat or SqlStudio.bin file from following location(s).

    On Server 2003, XP

    –For SQL Server Management Studio 2005:
    C:\Documents and Settings\dcoffey\Application Data\Microsoft\Microsoft SQL Server\90\Tools\Shell
    File is mru.dat

    On Server 2008, Vista and windows 7

    –For SQL Server Management Studio 2008:
    C:\Users\\AppData\Roaming\Microsoft\Microsoft SQL Server\100\Tools\Shell
    File is SqlStudio.bin

    –For SQL Server Management Studio 2005:
    C:\Users\\AppData\Roaming\Microsoft\Microsoft SQL Server\90\Tools\Shell
    File is mru.dat

    Kudos to Pinal Dave for such a great site. It has made my life a lot easier.
    Thank you.

    Like

  8. Unfortunately I don’t want to clear the whole list. In the past this list was in the Registry and could be edited.

    I see that the mru.dat files (which *(2!@#@($&* Window Search wouldn’t find for me) are now un-editable.

    Or has somebody devised an editor for the mru.dat files?

    I’m not sure but I think they may be serialized .NET objects, so theoritically…

    Makes me miss .INI files.

    Like

  9. Amazing that the programmers/testers at Microsoft put up with this inability to better manage the list. Something like FileZilla’s account management of FTP accounts is simple, editable, moveable to other computers, etc. C’mon MS!

    Like

  10. hi Pinal, When i was reading this article just one day ago i was looking for this over net but unfortunately i did’t find anything
    but in ur article mentioned about mru.dat file i have searched this file too but i did’t find find one file with name sqlstudio.bin
    one gyus in comment says about this file.could u plz tell me what is the purpose of this file and id mru.dat file is not available

    Like

  11. I was able to accomplish this using Tools -> Options -> Display X files in recently used list. Simply set it to 1 then back to 10. It took some fiddling, but my MRU list has apparently been cleared.

    Like

  12. Pingback: SQL SERVER – Beginning New Weekly Series – Memory Lane – #002 « SQL Server Journey with SQL Authority

  13. Pingback: SQL SERVER – Auto Recovery File Settings in SSMS – SQL in Sixty Seconds #034 – Video « SQL Server Journey with SQL Authority

  14. Pingback: SQL SERVER – Wrap SQL Code in SSMS – SQL in Sixty Seconds #038 – Video « SQL Server Journey with SQL Authority

  15. Pingback: SQL SERVER – Remove Cached Login from SSMS Connect Dialog – SQL in Sixty Seconds #049 | SQL Server Journey with SQL Authority

  16. Rather than deleting or renaming this file:
    1)Close SQL Management Studio
    2)Find the appropriate file(see post or responses above)
    3)Open the .bin in a text/hex editior like NotePad++
    4)Search for the name of one of the servers and identify the line number
    5)Make a copy of the .bin/.dat file
    6)Delete that line, make sure you delete the entire line, its possible if you have many the line could wrap.
    7)Open SQL Management Studio your dropdown will be blank

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s