如何删除 SQL Server Management Studio 的“连接到服务器”中的服务器条目屏幕?
在“连接到服务器”屏幕中,SQL Server Management Studio 存储您曾经输入的服务器名称、登录名和密码的所有条目。这非常有帮助,但有时情况会发生变化,服务器地址会发生变化,数据库不再可用。
如何从此屏幕删除服务器条目?此外,当您选择服务器时,列表中会显示过去的登录信息。再一次,这些发生了变化。如何删除用户条目?
Possible Duplicate:
How to remove “Server name” items from history of SQL Server Management Studio
In the "Connect to Server" screen, SQL Server Management Studio stores all entries you have ever entered for Server Name, login and password. This is very helpful, but from time to time things change, servers addresses change, databases are no longer available.
How can I delete server entries from this screen? Also, when you select a server, past logins are available in the list. Once again, these change. How can I delete user entries?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看起来此文件是 Microsoft.SqlServer.Management.UserSettings.SqlStudio 类的二进制序列化版本,该类在 Microsoft.SqlServer.Management.UserSettings, Version=10.0.0.0, Culture= 中定义。中性,PublicKeyToken=89845dcd8080cc91 程序集(位于c:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Microsoft.SqlServer.Management.UserSettings.dll >)。
凭借一点开发技能(Visual Studio 甚至 Powershell),您可以将此文件反序列化到原始类中,找到要删除的条目,然后将文件重新序列化回来。
这应该会给你一个想法(处理 .bin 文件的副本)...
在 Adrian 提出问题之后,我使用 Visual Studio 2010 在 Win7 x64 机器上再次尝试了这个。我发现了同样的错误,所以,在挖掘了一下之后我发现需要采取一些步骤才能解决。
自定义程序集解析需要做一些工作因为(至少对我而言)不清楚为什么 CLR 不能正确解析程序集以及为什么 Visual Studio 不允许我手动添加引用。我说的是 SqlWorkbench.Interfaces.dll。
更新后的代码如下所示:
Looks like this file is a binary serialized version of the
Microsoft.SqlServer.Management.UserSettings.SqlStudio
class defined in the Microsoft.SqlServer.Management.UserSettings, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91 assembly (located at c:\Program Files\Microsoft SQL Server\100\Tools\Binn\VSShell\Common7\IDE\Microsoft.SqlServer.Management.UserSettings.dll).With a bit of development skill (Visual Studio or even Powershell) you can deserialize this file into the original class, find the entries you want to remove and re-serialize the file back out.
This should give you the idea (working on a copy of the .bin file)...
After Adrian's question, I tried this again on a Win7 x64 box using Visual Studio 2010. I found the same error so, after digging a bit I found it took a number of steps to resolve.
The custom assembly resolution took a bit of doing since it wasn't obvious (to me, at least) why the CLR wouldn't just resolve the assembly correctly and why Visual Studio wouldn't allow me to add the reference manually. I'm talking about the SqlWorkbench.Interfaces.dll.
The updated code looks like this:
不幸的是,仅删除某些项目似乎不可能(或至少不可行)。
但是,如果需要,您可以重置配置并从头开始。
确保 Management Studio 已关闭,然后删除或重命名此文件:
请注意,该文件包含其他用户首选项设置,因此,如果您自定义了 Management Studio 配置,则需要进行一些恢复工作。
参考: http:// Social.msdn.microsoft.com/Forums/en-US/sqltools/thread/94e5c3ca-c76d-48d0-ad96-8348883e8db8/
祝你好运!
Unfortunately, it does not appear to be possible (or at least practical) to only remove certain items.
However, if you want, you can reset the configuration and start from scratch.
Make sure Management Studio is closed, then delete or rename this file:
Note that that file contains other user preference settings, so if you've customized your Management Studio configuration, you'll have some work to do restoring them.
Reference: http://social.msdn.microsoft.com/Forums/en-US/sqltools/thread/94e5c3ca-c76d-48d0-ad96-8348883e8db8/
Good luck!