SQL 如何删除sql实例
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/21370957/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to remove sql instance
提问by user2432772
My problem is that I can't remove instance. Here is an example right now I have two instances
我的问题是我无法删除实例。这是一个例子,现在我有两个实例
SQLEXPRESS
SQLEXPRESS2012
SQLEXPRESS
SQLEXPRESS2012
I have SQL Server 2012, in order to remove instance I go to Control Panel -> Add and remove programs ->
choose Microsoft Sql Server
and after that I will get to UI where I can do different manipulations with different stuff.
我有 SQL Server 2012,为了删除我Control Panel -> Add and remove programs ->
选择的实例Microsoft Sql Server
,然后我将进入 UI,在那里我可以对不同的东西进行不同的操作。
In this UI I am able to delete SQLEXPRESS2012
but I can't select SQLEXPRESS
. Also when I am in SQL Server Management Studio I can connect to SQLEXPRESS2012
server, but can't connect to SQLEXPRESS
server it gives me error:40 and 2.
在此 UI 中,我可以删除SQLEXPRESS2012
但无法选择SQLEXPRESS
. 此外,当我在 SQL Server Management Studio 中时,我可以连接到SQLEXPRESS2012
服务器,但无法连接到 SQLEXPRESS
服务器,它给了我错误:40 和 2。
My guess the instance not exist but some where it is in register. Any suggestions how to delete instance without going to control panel-> add and remove programs -> choose Microsoft Sql Server. Thank you for your time
我猜这个实例不存在,但它在注册的一些地方。任何建议如何在不进入控制面板的情况下删除实例-> 添加和删除程序-> 选择 Microsoft Sql Server。感谢您的时间
回答by Aaron Bertrand
Verify that there is really only one entry in Add/Remove Programs for SQL Server. I have multiple, one for every version of SQL Server I have installed:
验证在 SQL Server 的添加/删除程序中确实只有一个条目。我有多个,我安装的每个 SQL Server 版本都有一个:
If there really is only one entry in Control Panel, then it's possible you have some kind of corrupted install. Microsoft has a guide here for 2005, which may still be helpful in more modern versions (it's unclear from your question which version the old instance is). I've written about removing an expired instance of SQL Server before; this would be similar. Find the GUIDs listed under Uninstall in the following registry key (this may take some manual work) that do notinvolve SQL Server 2012:
如果控制面板中确实只有一个条目,那么您的安装可能已损坏。Microsoft 在此处提供了 2005 指南,该指南在更现代的版本中可能仍然有用(从您的问题中不清楚旧实例是哪个版本)。我之前写过关于删除过期的 SQL Server 实例的文章;这将是相似的。在以下注册表项(这可能需要一些手动工作)中找到卸载下列出的不涉及 SQL Server 2012的 GUID :
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
For example, here is the entry for the 2008 database engine services on my machine:
例如,这里是我机器上 2008 数据库引擎服务的条目:
For each one, copy the display name (in a comment) and the GUID file (behind msiexec /x
) to a .bat
file, e.g.
对于每一个,将显示名称(在注释中)和 GUID 文件(在后面msiexec /x
)复制到一个.bat
文件中,例如
REM SQL Server 2008 Database Engine Services
msiexec /x "{32445783-54FC-4AA7-A51A-3B528E8A5E3B}"
The number of entries you'll have will depend on the version, edition, selected features, etc. Once you've copied them all, save the .bat
file and double-click it. Depending on the order of the entries in the file, you may get some "unexpected error" results, or potentially errors like this one:
您将拥有的条目数量取决于版本、版本、所选功能等。将它们全部复制后,保存.bat
文件并双击它。根据文件中条目的顺序,您可能会得到一些“意外错误”结果,或者可能出现如下错误:
If you get any of the former, you should run the batch file again.
如果你得到任何前者,你应该再次运行批处理文件。
Of course, if you don't want to risk any damage to your system, you could always just disable the SQLEXPRESS instance's services using SQL Server Configuration Manager, and pretend it's not installed.
当然,如果您不想冒险对您的系统造成任何损害,您可以随时使用 SQL Server 配置管理器禁用 SQLEXPRESS 实例的服务,并假装它没有安装。