Uninstalling the SQL Server Database
Prerequisites
Before you uninstall the SQL Server 2012, ensure that all data in the database is no longer needed.
If eSight has been installed, uninstall eSight first.
Procedure
- Log in to the operating system using an account with administrator rights.
- Choose Start > All Programs > Microsoft SQL Server 2012 > Configuration Tools > SQL Server Configuration Manager.
- In the dialog box that is displayed, choose SQL Server Configuration Manager > SQL Server Services.
- In the right pane, right-click programs whose State is Running and choose Stop.
- Choose Start > Control Panel > Programs and Features. The Uninstall or change a program dialog box is displayed.
- Right-click Microsoft SQL Server 2012 (64-bit) and click Uninstall.
During the uninstallation process, if the system displays the restarting state as failed, delete the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations entry according to Uninstalling the SQL Server Database.
- Complete the subsequent operations according to the instructions.
- After the uninstallation process of the Microsoft SQL Server 2012 (64-bit) is complete, the Uninstall or change a program dialog box is displayed. Right-click in the blank area and choose Refresh from the short-cut menu. Then select the remaining SQL Server programs and click Uninstall.
- Choose Start > All Programs to verify that Microsoft SQL Server 2012 has been successfully uninstalled. Otherwise, right-click Microsoft SQL Server 2012 and click Delete.
- Choose Start > Run and enter regedit to start the registry editor of the operating system.
Ensure that the following entries are deleted. Delete it manually if any entry remains:
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server 2005 Redist
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server 2012 Redist
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server Native Client 10.0
- HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\MSSQLSERVER
- HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SQLSERVERAGENT
- HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSQLServerADHelper
- HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\MSSQLServerADHelper100
- HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations
- HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSDTC
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup\ExceptionComponents
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\setup.exe\RunAsOnNonAdminInstall
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\setup.exe\BlockOnTSNonInstallMode
- Optional: Delete related folders of the database.
You are advised to delete the left-over folders if you have already backed up the data in the database or the data is no longer in need:
- Delete the MSSQL2012, MSSQL2012X, and MSDATA folders in the database installation directory.
- Delete the Microsoft SQL Server folder in the Program files folder in the database installation directory.
- Delete the Microsoft SQL Server folder in the Program files (x86) folder in the database installation directory.
- Delete the Microsoft SQL Server folder in the Program files folder in the operating system installation directory.
- Delete the Microsoft SQL Server and Microsoft SQL Server Compact Edition folders in the Program files (x86) folder in the operating system installation directory.
- Restart the operating system after the preceding operations are complete.