Manually uninstall Microsoft SQL Server

Manually uninstall Microsoft SQL Server


I had several different instances of MS SQL Server and different versions of Visual Studio on my laptop and when I tried to uninstall SQL Server via Control Panel, it gave an error. So I followed the steps below:

  • Stop SQL Server Services: Before proceeding with the uninstallation process, ensure that all SQL Server services are stopped. Open the "Services" application from the Windows search bar, locate any services related to SQL Server, and stop them.
  • Uninstall SQL Server component s: Open the Control Panel, navigate to Programs and Features, and find "Microsoft SQL Server ****" in the list of installed programs. Right-click on it and select "Uninstall".
  • Delete SQL Server Data Directories: Manually delete any data directories or files associated with SQL Server. These may include the data files, log files, and backup files stored on your system. Common directories to check include C:\Program Files\Microsoft SQL Server and C:\Program Files (x86)\Microsoft SQL Server.
  • Remove Registry Entries: Be cautious when editing the Windows Registry. Open the Registry Editor (search for "regedit" in the Windows search bar) and navigate to the following registry keys:
    - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server
    - HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSQLSERVER (or any SQL Server instance name)
    - And delete any keys or entries related to SQL Server.
  • Clean Up Program Files: Navigate to the installation directory where SQL Server was installed and delete any remaining files or folders.
  • Restart Your Computer: After completing the uninstallation process and cleaning up any remaining files, restart your computer to ensure that all changes take effect.
Seyed Hamed Vahedi Seyed Hamed Vahedi     Sun, 5 January, 2025