General method to uninstall SQL Server on Windows system completely

Time:2024-2-1

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.



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”).

General method to uninstall SQL Server on Windows system completely

Locate all SQL Server services and stop them all (may vary by version)
General method to uninstall SQL Server on Windows system completely
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.
General method to uninstall SQL Server on Windows system completely


Uninstalling the SQL Server Database

Open the control panel

General method to uninstall SQL Server on Windows system completely

Find the program and click [Uninstall Program

General method to uninstall SQL Server on Windows system completely

Locate the SQL Server related application (may vary by version)

General method to uninstall SQL Server on Windows system completely

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))

General method to uninstall SQL Server on Windows system completely

Select [Delete] in the program box that pops up

General method to uninstall SQL Server on Windows system completely

Click [OK].

General method to uninstall SQL Server on Windows system completely

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!!!!!.

General method to uninstall SQL Server on Windows system completely

Select [Select All] and click [Next].

General method to uninstall SQL Server on Windows system completely

Click [Next].

General method to uninstall SQL Server on Windows system completely

Click [Delete].

General method to uninstall SQL Server on Windows system completely

Here, wait for it to finish deleting

General method to uninstall SQL Server on Windows system completely

See if the status is all [Success]. If they are all successful, just click [Close].

General method to uninstall SQL Server on Windows system completely
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)

General method to uninstall SQL Server on Windows system completely
A warning message will pop up here, don’t worry about it, just choose [Yes].
General method to uninstall SQL Server on Windows system completely

Finally, uninstall all other SQL Server programs.

General method to uninstall SQL Server on Windows system completely

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].

General method to uninstall SQL Server on Windows system completely

Go to C:\Program Files (x86) folder, find the Microsoft SQL Server folder, the mouse [right click] – [Delete]

General method to uninstall SQL Server on Windows system completely

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

General method to uninstall SQL Server on Windows system completely

······

General method to uninstall SQL Server on Windows system completely

In C:\Users\20972\AppData\Roaming\Microsoft folder (just under this folder), find the SQL Server Management Studio folder mouse [right click] – [Delete].

General method to uninstall SQL Server on Windows system completely


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].

General method to uninstall SQL Server on Windows system completely

······

General method to uninstall SQL Server on Windows system completely

locateHKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control and expand

General method to uninstall SQL Server on Windows system completely

In the list just expanded to find Session Manager, on the right side of the PendingFileRenameOperations mouse [right click] – [Delete].

General method to uninstall SQL Server on Windows system completely

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:

General method to uninstall SQL Server on Windows system completely
Then findHKEY_LOCAL_MACHINE \SOFTWARE\Microsoft and Expanded

General method to uninstall SQL Server on Windows system completely

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!

General method to uninstall SQL Server on Windows system completely
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!!!!

Recommended Today

DML statements in SQL

preamble Previously we have explained DDL statements in SQL statements. Today we will continue with the DML statement of SQL. DML is the Data Manipulation Language.Used to add, delete, and change data operations on the tables in the library.。 1. Add data to the specified field(INSERT) 2. Modify data(UPDATE) 3. Delete data(DELETE) catalogs preamble I. […]