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)

Best Practices, Database, DBA, SQL Scripts, Vista
Previous Post
SQL SERVER – Fix : Error: 4064 – Cannot open user default database. Login failed. Login failed for user
Next Post
SQLAuthority News – 5 Millions Visitors – 2 Anniversary – Authors Note on Economy Slow Down and Job Opportunity – SQL Server

Related Posts

27 Comments. Leave new

  • Imran Mohammed
    November 6, 2008 6:45 am

    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.

    Reply
  • 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.

    Reply
  • 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

    Reply
  • Thanks for the great writeup. This helps me alot in my decision making.

    Reply
  • 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.

    Reply
  • Forest, same here – no issues with DELETING or renaming ….Microsoft\Microsoft SQL Server\100\Tools\Shell\SqlStudio.bin

    Reply
  • Amit kulkarni
    May 6, 2010 12:18 pm

    Good Article. I was able to clear the old connections.

    Thanks
    Amit K

    Reply
  • 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?

    Reply
  • 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.

    Reply
  • 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.

    Reply
  • 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!

    Reply
  • 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

    Reply
  • thnx dude

    Reply
  • 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.

    Reply
  • zacharydl,

    That’s not what this article is about.

    Reply
  • @zacharydl – worked for me thanks, no deleting of files required.

    Reply
  • I have sql server 2008 running under windows xp. I could not find mru.dat file in either location. Please advice.

    Reply
  • Your blog is great. It helped me. Thanks Pinal.

    Reply
  • Thanks Pinal Sir. This is a very nice article for clearing SQL database list.
    Thanks for sharing.

    Reply
  • How can I connect to default server automatically at start up in SSMS 2005?
    It shows me “Connect to server” box every time!

    Reply

Leave a ReplyCancel reply

Exit mobile version