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

前端 未结 15 2423
南方客
南方客 2020-11-28 20:33

When trying to connect to a server in Management Studio (specifically 2008), there is a field where you enter the Server name. That field also has a drop-down list where it

相关标签:
15条回答
  • 2020-11-28 21:21

    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.

    0 讨论(0)
  • 2020-11-28 21:22

    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/

    0 讨论(0)
  • 2020-11-28 21:23

    For Windows Vista and SQL Server 2005,

    Delete this file, or open it with the Notepad and clear the server names that you want Clear from the history

    %UserProfile%\Microsoft\Microsoft SQL Server\90\Tools\Shell\mru.dat
    
    0 讨论(0)
  • 2020-11-28 21:27

    Delete the file from above path: (Before delete please close SSMS)

    File location path for the users of SQL Server 2005,

    C:\Documents and Settings\%USERNAME%\Application Data\Microsoft\Microsoft SQL Server\90\Tools\Shell\mru.dat
    

    File location path for the users of SQL Server 2008,

    Note: Format Name has been changed.

    C:\Documents and Settings\%USERNAME%\Application Data\Microsoft\Microsoft SQL Server\100\Tools\Shell\SqlStudio.bin
    

    File location path for the users of Server 2008 standard/SQL Express 2008

    C:\Documents and Settings\%USERNAME%\Microsoft\Microsoft SQL Server\100\Tools\Shell\SqlStudio.bin
    

    File location path for the users of SQL Server 2012,

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

    File location path for the users of SQL Server 2014,

    C:\Users\%USERNAME%\AppData\Roaming\Microsoft\SQL Server Management Studio\12.0\SqlStudio.bin
    

    Note: In SSMS 2012 (Version 10.50.1600.1 OR Above), ow you can remove the server name by selecting it from dropdown and press DELETE.

    0 讨论(0)
  • 2020-11-28 21:28

    Rather than deleting or renaming this file:

    1. Close SQL Server Management Studio.
    2. Find the appropriate file (see the other posts).
    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, it's possible if you have many the line could wrap.
    7. Open SQL Server Management Studio. Your dropdown will be blank.
    0 讨论(0)
  • 2020-11-28 21:30

    Here is an easy way.

    Open the connection window, click on the Server name dropdown, and hover over the connection string you want to delete, then press delete.

    0 讨论(0)
提交回复
热议问题