How to completely uninstall SQL Server

This article will show you how to uninstall SQL Server completely. Follow the steps in this article, you also need to prepare the system to be able to reinstall SQL Server.

This article will show you how to uninstall SQL Server completely. Follow the steps in this article, you also need to prepare the system to be able to reinstall SQL Server.

Note : To uninstall an instance of SQL Server, you must be an administrator who has the right to login as a service. To uninstall a failover cluster of SQL Server, you need to use the Remove Node function available in SQL Server Setup to remove individual nodes.

Before uninstalling SQL Server, note the following important things:

  1. Before uninstalling SQL Server components from a computer with a minimum physical memory capacity, make sure that the page file size is sufficient. The page file size must be twice the amount of physical memory. Inadequate virtual memory can cause incomplete SQL Server uninstallation.
  2. If there are multiple versions of SQL Server, SQL Server Browser will automatically uninstall when the last version of SQL Server 2017 is uninstalled. If you want to uninstall all components of SQL Server 2017, you must uninstall the manual SQL Server Browser component from Programs and Features in Control Panel .
  3. When uninstalling SQL Server will delete the tempdb data file that was added during installation. The file has the name or part of the name tempdb_mssql _ *. Ndf will be deleted if they exist in the system database directory.

Picture 1 of How to completely uninstall SQL Server

Before uninstalling SQL Server

Step 1: Backup data

Although this is not a required step, many people want to back up the database with their current state or want to save changes made in the system database. Therefore perform data backup before uninstalling SQL Server. Also, save a copy of all data and log files in a folder, not saved in the MSSQL folder because this folder will be deleted during the uninstallation.

The files you must save include the following database files:

  1. Master.mdf
  2. Mastlog.ldf
  3. Model.mdf
  4. Modellog.ldf
  5. Msdbdata.mdf
  6. Msdblog.ldf
  7. Mssqlsystemresource.mdf
  8. Mssqlsustemresource.ldf
  9. Tempdb.mdf
  10. Templog.ldf
  11. ReportServer [$ Version name]. This is Reporting Services' default database.
  12. ReportServer [$ Version name] TempDB. This is Reporting Services' default temporary database

Step 2: Delete security groups on the machine.

Before uninstalling SQL Server, delete local security groups for SQL Server components.

Step 3: Stop all SQL Server services

You should stop all SQL Server services before removing the SQL Server components. The connection is still active, which may prevent successful uninstall.

  1. How to start and stop services in MS SQL Server

Step 4: Use an account with appropriate permissions.

Log in to the server using the SQL Server service account or use an account with equivalent permissions. For example, you can log on to the server by using the account that is a member of the Local Administrators group.

 

Remove a version of SQL Server

Method 1: Uninstall SQL Server in Control Panel

Step 1. To start the uninstall process, go to Control Panel , then select Programs and Features .

Step 2. Right-click SQL Server and select Uninstall , then click Remove . This will launch the SQL Server Installation Wizard. Setup Support Rules run to verify computer configuration. To continue, click Next .

Step 3. On the Select Instance page, use the drop-down box to specify a version of SQL Server to remove, or specify the option to only remove the sharing features of SQL Server and management tools. To continue, click Next .

Step 4. On the Select Features page, specify the features to remove specific versions of SQL Server. Running rules to verify that the operation can complete successfully.

Step 5. On the Ready to Remove page, review the list of components and features that will be uninstalled, then click Remove to start uninstalling.

Step 6. Immediately after uninstalling the final version of SQL Server, other programs associated with SQL Server will still show up in the programs list in Programs and Features . However, if you close Programs and Features and open it the next time, it will refresh the list of programs, showing only the programs that are still installed.

Method 2: Uninstall SQL Server in regedit

If the above method fails, you can manually uninstall SQL Server according to the steps below:

Step 1 : Back up the registry.

Step 2: Delete the following keys in regedit:

HKEY_LOCAL_MACHINESOFTWAREMicrosoft Microsoft SQL Server

HKEY_LOCAL_MACHINESOFTWAREMicrosoftMSSQLServer

Step 3: Go to the following key: HKEY_LOCAL_MACHINESOFTWAREMicrosoftWindowsCurrentVersionUninstall and delete all sub keys related to SQL Server.

Step 4: Go to the following key: HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServices and delete all key related to SQL Server

Step 5: Delete all SQL Server folders in the computer at C: Program Files Microsoft SQL Server and other subdirectories.

If the uninstallation fails, try to find the cause and fix the problem. In some cases, such as deleting important files accidentally, reinstalling the operating system before reinstalling SQL Server. However, if it still doesn't work, you can contact Microsoft Support to get support.

See more:

  1. Learn about the architecture of MS SQL Server
  2. Instructions for installing MS SQL Server
  3. How to create a database in MS SQL Server
Update 19 February 2022
Category

System

Mac OS X

Hardware

Game

Tech info

Technology

Science

Life

Application

Electric

Program

Mobile