如何删除“服务器名称” SQL Server Management Studio 历史记录中的项目

发布于 2024-07-25 22:10:33 字数 183 浏览 4 评论 0原文

当尝试连接到 Management Studio(特别是 2008)中的服务器时,有一个字段可供您输入服务器名称。 该字段还有一个下拉列表,其中显示您尝试连接的服务器的历史记录。

  1. 如何删除单个项目 从那段历史?
  2. 如何删除 登录字段历史记录中的项目 每个服务器名称?

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 shows a history of servers that you have attempted to connect to.

  1. How to remove an individual item
    from that history?
  2. How to remove an
    item from the Login field history
    for each Server name?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(15

三生殊途 2024-08-01 22:10:34

在带有 SQL Express 2008 的 Windows Server 2008 标准中,“SqlStudio.bin”文件位于此处:

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

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

%UserProfile%\Microsoft\Microsoft SQL Server\100\Tools\Shell\
許願樹丅啲祈禱 2024-08-01 22:10:34

在 SSMS 2012 中,有一种记录在案的方法可以从“连接到服务器”对话框中删除服务器名称。 现在,我们可以通过在对话框中选择服务器名称并按 DELETE 来删除服务器名称。

In SSMS 2012 there is a documented way to delete the server name from the "Connect to Server" dialog. Now, we can remove the server name by selecting it in the dialog and pressing DELETE.

季末如歌 2024-08-01 22:10:34

从以上路径删除文件:(删除前请关闭SSMS)

SQL Server 2005用户的文件位置路径,< /em>

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

SQL Server 2008 用户的文件位置路径,

注意: 格式名称已更改。

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

Server 2008 standard/SQL Express 2008 用户的文件位置路径

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

SQL Server 2012 用户的文件位置路径、

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

SQL 用户的文件位置路径Server 2014,

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

注意:SSMS 2012版本 10.50.1600.1 或以上)中,您可以通过以下方式删除服务器名称:从下拉列表中选择它并按DELETE

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.

顾忌 2024-08-01 22:10:34

文件SqlStudio.bin实际上包含“Microsoft.SqlServer.Management.UserSettings.SqlStudio”类型的二进制序列化数据。

使用 BinaryFormatter 类,您可以编写简单的 .NET 应用程序来编辑文件内容。

File SqlStudio.bin actually contains binary serialized data of type "Microsoft.SqlServer.Management.UserSettings.SqlStudio".

Using BinaryFormatter class you can write simple .NET application in order to edit file content.

烟燃烟灭 2024-08-01 22:10:34

从命令提示符(开始\所有程序\附件\命令提示符):

DEL /S SqlStudio.bin

From the Command Prompt (Start \ All Programs \ Accessories \ Command Prompt):

DEL /S SqlStudio.bin
丑疤怪 2024-08-01 22:10:34

对于 Windows Vista 和 SQL Server 2005,

删除此文件,或使用记事本打开它,然后清除要从历史记录中清除的服务器名称

%UserProfile%\Microsoft\Microsoft SQL Server\90\Tools\Shell\mru.dat

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
尸血腥色 2024-08-01 22:10:34

C:\Users\\AppData\Roaming\Microsoft\Microsoft SQL Server\100\Tools\Shell

C:\Users\\AppData\Roaming\Microsoft\Microsoft SQL Server\100\Tools\Shell

可爱暴击 2024-08-01 22:10:34

不要删除或重命名此文件:

  1. 关闭 SQL Server Management Studio。
  2. 找到适当的文件(请参阅其他帖子)。
  3. 在文本/十六进制编辑器(如 NotePad++)中打开 .bin。
  4. 搜索其中一台服务器的名称并识别行号。
  5. 制作 .bin/.dat 文件的副本。
  6. 删除该行。 确保删除整行,如果有很多行可能会换行。
  7. 打开 SQL Server Management Studio。 您的下拉列表将为空白。

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.
苯莒 2024-08-01 22:10:33

从 SQL Server 2012 开始,您不再需要经历删除 bin 文件的麻烦(这会导致其他副作用)。 您应该能够在连接到服务器 对话框中的服务器名称: 下拉列表的MRU 列表中按删除键。 这记录在此连接项中此博文

展开下拉列表后,将鼠标悬停在要删除的项目上,并突出显示该项目,在下拉列表仍处于展开状态时,按 Delete< /kbd> 键。 (如果您的键盘有两个这样的键,请使用不兼作 Backspace 的键,这在以 Mac 为中心的键盘中很常见。)下拉列表将立即重新绘制并删除选择:

从 MRU 列表中删除条目之前和之后

请注意,如果单个服务器名称有多个条目(例如,一个具有 Windows 身份验证,一个具有 SQL 身份验证),您将无法辨别您是哪一个删除。 由于它是一个 MRU 列表,因此在您再次成功连接之前顺序不会改变,因此您可以通过选择您认为正确的项目来解决此问题,并检查选择后哪些凭据会弹出到对话框的其余部分。 当您确定要删除的条目后,请将鼠标悬停在扩展下拉列表中的该条目上并按删除重复上述过程>。

在旧版本中,您可以通过删除 SqlStudio.binmru.dat 并让 SSMS 重新生成文件来删除整个列表,但这是一种暴力方法 - 不是它不仅删除了所有连接条目,而且还清除了其他设置。 为了更加手术,您必须弄清楚如何正确修改这些文件,这不是一件容易的任务(请参阅这个< /a> 和这个)。 在较新的版本中,您可以修改 UserSettings.xml - 它以更易于理解的形式存储这些设置。

  1. 关闭 SSMS 的所有实例

  2. 导航到 %appdata%\Microsoft\SQL Server Management Studio

  3. 深入了解您想要影响的主要版本,例如 18.0(您可能只有一个,或者您可能需要重复多个) - 而不是带有 _IsoShell 后缀的文件夹

  4. 制作UserSettings.xml的备份副本

  5. 使用记事本打开 UserSettings.xml

  6. 查找您要查找的服务器条目

    它可能是这样的单个条目,在这种情况下,您可以删除整个 节点:

    <块引用>

    单个条目示例

    或者它可能是一个复合条目,您在其中以不同方式(不同的身份验证方法或不同的 SQL 身份验证用户名)连接到相同的服务器/实例名称。 在这种情况下,您需要(小心!)仅删除感兴趣的 。 对于 Windows 身份验证,它将如下所示,其中 AuthenticationMode 将为 0

    <块引用>

     Windows 身份验证 MRU 列表项

    对于 SQL 身份验证,AuthenticationMode 将为 1,您可以通过 确定要删除的 <用户名>

    <块引用>

     SQL 身份验证 MRU 列表项

  7. 保存UserSettings.xml并重新启动SSMS

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: drop-down in the Connect to Server dialog. This is documented in this Connect item and this blog post.

With the drop-down expanded, hover over the item you want to remove, and with it highlighted while the drop-down is still expanded, press the Delete key. (If you have a keyboard with two such keys, use the one that doesn't double as Backspace, common with Mac-centric keyboards.) The drop-down list will redraw immediately and remove the selection:

Before & after removing entry from MRU list

Note that if you have multiple entries for a single server name (e.g. one with Windows Authentication and one with SQL Authentication), you won't be able to tell which one you're deleting. Since it is an MRU list, the order won't change until you make another successful connection, so you can solve this by selecting the item you think is the right one, and checking which credentials pop into the remainder of the dialog once selected. When you've identified the one to delete, then repeat the process above by hovering over that entry in the expanded drop-down list and pressing Delete.

In older versions you could delete the entire list by deleting SqlStudio.bin or mru.dat and letting SSMS re-generate the file, but this was a brute force method - not only did it delete all connection entries, but it blew away other settings, too. To be more surgical, you'd have to figure out how to modify those files correctly, and this is not an easy task (see this and this). In newer versions, you can modify UserSettings.xml - which stores these settings in a much more human readable form.

  1. Close down all instances of SSMS

  2. Navigate to %appdata%\Microsoft\SQL Server Management Studio

  3. Drill into the major version you want to impact, like 18.0 (you may only have one, or you may have to repeat for multiple) - and not the folder with the _IsoShell suffix

  4. Make a backup copy of UserSettings.xml

  5. Open UserSettings.xml with notepad

  6. Find the server entry you're looking for

    It may be a single entry like this, in which case, you can delete the entire <Element> node:

    Example single entry

    Or it may be a compound entry, where you've connected to the same server/instance name in different ways (different authentication methods or different SQL Authentication usernames). In this case, you want to (carefully!) delete just the <Item> of interest. For Windows Authentication it will look like this, where AuthenticationMode will be 0:

    Windows Authentication MRU list item

    And for SQL Authentication, AuthenticationMode will be 1, and you can identify which <Item> to remove by the <UserName>:

    SQL Authentication MRU list item

  7. Save UserSettings.xml and restart SSMS

缱倦旧时光 2024-08-01 22:10:33

这是从此列表中清除项目的最简单方法。

  1. 打开您想要影响的 Microsoft SQL Server Management Studio (SSMS) 版本。
  2. 打开连接到服务器对话框(文件 > 连接对象资源管理器、对象资源管理器 > 连接 > 数据库引擎等)。
  3. 单击服务器名称字段下拉列表的向下箭头
  4. 将鼠标悬停在要删除的项目上
  5. 按键盘上的删除 (DEL) 键。

我们开始吧。

Here is the simplest 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.

喜爱皱眉﹌ 2024-08-01 22:10:33

对于 SQL 2005,删除文件:

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

对于 SQL 2008,文件位置、格式和名称已更改:

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

如何清除列表:

  1. 关闭 SSMS 的所有实例
  2. 删除/重命名文件
  3. 打开 SSMS

此请求已在 Microsoft Connect 上注册

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

呆橘 2024-08-01 22:10:33

这个重复的问题上,@arcticdev 发布了一些代码,这些代码将删除单个条目(而不是删除 bin 文件中的所有条目) )。
我将它包装在一个非常丑陋的用户界面中并将其放在这里: http://ssmsmru.codeplex.com/

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/

风轻花落早 2024-08-01 22:10:33

对于 SQL Server 2012 Management Studio,此文件已移动。 它现在位于:

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

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
铁轨上的流浪者 2024-08-01 22:10:33

这是一个简单的方法。

打开连接窗口,单击服务器名称下拉列表,并将鼠标悬停在要删除的连接字符串上,然后按删除。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文