General method to uninstall SQL Server on Windows system completely
Installation and uninstallation of SQL Server is always a headache for us. Because no matter it is SQL Server or MySQL database, when we have problems with the database due to unknown reasons and want to uninstall and reinstall it, we will have a problem.If the database is not uninstalled cleanly, it will cause the database reinstallation to failThis article is about uninstalling SQL Server 2012 as an example. So it is important to learn how to uninstall SQL Server. This article takes uninstalling SQL Server 2012 as an example, and the uninstallation methods for other versions are similar.
Article Catalog
Stopping the SQL Server Service
First of all, you need to turn off the services of SQL Server, search for “Services” in the search box at the bottom of Windows and open it (or press and hold the Win + R keys at the same time, and enter [services.msc] command in the pop-up run box to enter the “Services”).
Locate all SQL Server services and stop them all (may vary by version)
Right mouse button – [Stop] or click [Stop] on the left side of the mouse, choose one of the two ways to stop the service.You need to delete the SQL Server folder, if the deletion is unsuccessful, then the SQL Server service is not turned off.)
Uninstalling the SQL Server Database
Open the control panel
Find the program and click [Uninstall Program
Locate the SQL Server related application (may vary by version)
First find Microsoft SQL Server 2012 (64-bit) [right mouse button] – [Uninstall/Change] (for other versions find the corresponding (64-bit) program, e.g. for SQL Server 2019 find Microsoft SQL Server 2019 (64-bit))
Select [Delete] in the program box that pops up
Click [OK].
Select the example and click [NextNote: When selecting examples, how many instance IDs here are deleted how many times, if there are two instance IDs, after deleting one round, you need to repeat the operation of the previous step and then come back here to delete again, to delete all the instances one by one!!!!!.
Select [Select All] and click [Next].
Click [Next].
Click [Delete].
Here, wait for it to finish deleting
See if the status is all [Success]. If they are all successful, just click [Close].
Find Microsoft SQL Server 2012 Native Client [right mouse button] – [Uninstall], in the pop-up dialog box, select [Yes] (other versions to find the corresponding Native Client program, such as: SQL Server 2019 to find Microsoft SQL Server 2019 Native Client)
A warning message will pop up here, don’t worry about it, just choose [Yes].
Finally, uninstall all other SQL Server programs.
Note: Some versions of SQL Server have a separate SQL Server Management Studio (SSMS) management tool that must be uninstalled as well.
Deleting SQL Server Related Files
Note: Different versions may not have some files, just skip them if you don't have them.
Find their previous installation of Microsoft SQL Server directory (default installation in the C drive) mouse [right click] – [Delete], and then enter the C:\Program Files folder, find the Microsoft SQL Server folder mouse [right click] – [Delete].
Go to C:\Program Files (x86) folder, find the Microsoft SQL Server folder, the mouse [right click] – [Delete]
Go to C:\Users\20972\AppData\Roaming\Microsoft folder (that is, C:\Users\your own computer’s user name\AppData\Roaming\Microsoft, here my user name is 20972), find the Microsoft SQL Server folder Right click on the mouse – [Delete].
Note: Since AppData is a hidden file, if you need to show the hidden items, you can find them by following the instructions below
······
In C:\Users\20972\AppData\Roaming\Microsoft folder (just under this folder), find the SQL Server Management Studio folder mouse [right click] – [Delete].
Delete SQL Server related registry
Directly in the lower-left corner of the computer Windows [Start] icon on the mouse [right click] – [Run] (or press and hold the Win + R keys at the same time), in the pop-up run box, type [regedit] – [OK] to open the [registry].
······
locateHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control and expand
In the list just expanded to find Session Manager, on the right side of the PendingFileRenameOperations mouse [right click] – [Delete].
Note: This must be deleted, otherwise when reinstalling SQL Server later on, [Failed to restart the computer] will appear as shown in the example below:
Then findHKEY_LOCAL_MACHINE \SOFTWARE\Microsoft and Expanded
Find all items related to SQL Server, right click – [Delete].
Note: Everyone's may be different, look down the list and remove anything with SQL Server in it!
Then follow the same method to deleteHKEY_CURRENT_USER SQL Server-related content below:
Note: Depending on your computer, if there are other items related to SQL Server, delete them all.
HKEY_CURRENT_USER \SOFTWARE\Microsoft\ Microsoft SQL Server
HKEY_CURRENT_USER \SOFTWARE\Microsoft\ SQL Server Management Studio
V. Restarting the computer
After doing all of the above, be sure to restart your computer.
After restarting the computer, SQL Server is completely uninstalled from the computer.
Reinstalling it later won’t be a problem.
If the article was helpful to you guys and gals feel free to trifecta!!!!
Also, any errors in the article are welcome!!!!