My problem is that I can't remove instance. Here is an example right now I have two instances
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.
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.
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
To delete a database, connect to an instance of the SQL Server, and then expand that instance. Expand Databases, select the database which need to be deleted. Right-click the database which need to be deleted, and then click Delete.
The instance of SQL Server is not uninstalled. Important. Before you use this procedure to remove an instance of SQL Server from the SQL Server Utility, make sure that the SQL Server and SQL Server Agent services are running on the instance to remove. From the Utility Explorer in SQL Server Management Studio, click on Managed Instances.
1 Use the drop-down to select Instance, mark the SQL Server instance name, or the option to remove only SQL Server shared... 2 On the Select Features page, choose the features which required to be removed from the instance of SQL Server. More ...
Note that it is important to refer to the SQL Server instance name exactly as it is stored in SQL Server. On a case-sensitive instance of SQL Server, you must specify the instance name using the exact casing as returned by @@SERVERNAME.
To get the instance name for the managed instance of SQL Server, run this query on the managed instance: select @@SERVERNAME AS instance_name. At this point, the managed instance of SQL Server is fully removed from the UCP. It disappears from the list view the next time you refresh data for the SQL Server Utility.
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:
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 not involve SQL Server 2012:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\
For example, here is the entry for the 2008 database engine services on my machine:
For each one, copy the display name (in a comment) and the GUID file (behind msiexec /x
) to a .bat
file, e.g.
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:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With