Skip to content

Latest commit

 

History

History
124 lines (77 loc) · 8.35 KB

uninstall-an-existing-instance-of-sql-server-setup.md

File metadata and controls

124 lines (77 loc) · 8.35 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic helpviewer_keywords
Uninstall an Existing Instance of SQL Server (Setup)
This article describes how to uninstall a stand-alone instance of SQL Server, which also prepares the system so that you can reinstall SQL Server.
rwestMSFT
randolphwest
02/28/2025
sql
install
conceptual
removing instances of SQL Server
uninstalling instances of SQL Server
removing SQL Server
instances of SQL Server, uninstalling
uninstalling SQL Server

Uninstall an existing instance of SQL Server (Setup)

[!INCLUDE SQL Server Windows Only]

This article describes how to uninstall a stand-alone instance of [!INCLUDE ssNoVersion]. By following the steps in this article, you also prepare the system so that you can reinstall [!INCLUDE ssNoVersion].

To uninstall a Cumulative Update, see Uninstall a Cumulative Update from SQL Server.

Note

To uninstall a [!INCLUDE ssNoVersion] failover cluster, use the Remove Node functionality provided by [!INCLUDE ssNoVersion] Setup to remove each node individually. For more information, see Add or remove nodes in a failover cluster instance (Setup)

Considerations

  • To uninstall SQL Server, you must be a local administrator with permissions to log on as a service.

  • If your computer has the minimum required amount of physical memory, increase the size of the page file to two times the amount of physical memory. Insufficient virtual memory can result in an incomplete removal of SQL Server.

  • On a system with multiple instances of SQL Server, the SQL Server browser service is uninstalled only once the last instance of SQL Server is removed. The SQL Server Browser service can be removed manually using the same procedure as removing SQL Server.

  • Uninstalling [!INCLUDE ssNoVersion] deletes tempdb data files that were added during the install process. Files with tempdb_mssql_*.ndf name pattern are deleted if they exist in the system database directory.

Prepare

  1. Back up your data. Either create full backups of all databases, including system databases, or manually copy the .mdf and .ldf files to a separate location. The master database contains all system level information for the server, such as logins, and schemas. The msdb database contains job information such as SQL Server agent jobs, backup history, and maintenance plans. For more information about system databases, see Back up and restore: System databases (SQL Server).

    The files that you must save include the following database files 1:

    • master.mdf
    • mastlog.ldf
    • msdbdata.mdf
    • msdblog.ldf
    • model.mdf
    • modellog.ldf
    • mssqlsystemresource.mdf
    • mssqlsystemresource.ldf
    • ReportServer[$InstanceName] data and log files 2
    • ReportServer[$InstanceName]TempDB data and log files 2

    1 You can't back up the tempdb system database.

    2 The ReportServer databases are included with SQL Server Reporting Services.

  2. Stop all [!INCLUDE ssNoVersion] services. We recommend that you stop all [!INCLUDE ssNoVersion] services before you uninstall [!INCLUDE ssNoVersion] components. Active connections can prevent successful uninstallation.

  3. Use an account that has the appropriate permissions. Sign in to the server by using the [!INCLUDE ssNoVersion] service account or by using an account that has equivalent permissions. For example, you can connect to the server by using an account that is a member of the local Administrators group.

Uninstall

To uninstall SQL Server from Windows 10, Windows Server 2016, Windows Server 2019, and greater, follow these steps.

  1. To begin the removal process, navigate to Settings from the Start menu. Depending on which version of Windows you installed, choose Apps, or Apps > Installed apps.

  2. Search for sql in the search box.

  3. Select Microsoft SQL Server (Version) (Bit). For example, Microsoft SQL Server 2017 (64-bit).

  4. Select Uninstall.

    :::image type="content" source="media/uninstall-an-existing-instance-of-sql-server-setup/uninstall-sql-server-windows-10.png" alt-text="Screenshot showing how to uninstall SQL Server.":::

    If you use a newer version of Windows, the user interface might look different.

  5. Select Remove on the SQL Server dialog pop-up to launch the Microsoft SQL Server installation wizard.

    :::image type="content" source="media/uninstall-an-existing-instance-of-sql-server-setup/remove-sql-2017.png" alt-text="Screenshot showing how to remove SQL Server.":::

  6. On the Select Instance page, use the dropdown list to specify an instance of [!INCLUDE ssNoVersion] to remove, or specify the option to remove only the [!INCLUDE ssNoVersion] shared features and management tools. To continue, select Next.

  7. On the Select Features page, specify the features to remove from the specified instance of [!INCLUDE ssNoVersion].

  8. On the Ready to Remove page, review the list of components and features that will be uninstalled. Select Remove to begin uninstalling

  9. Refresh the Apps and Features window to verify the SQL Server instance was removed successfully, and determine which, if any, SQL Server components still exist. Remove these components from this window as well, if you so choose.

To uninstall SQL Server from Windows Server 2008, Windows Server 2012 and Windows 2012 R2, follow these steps.

  1. To begin the removal process, navigate to the Control Panel and then select Programs and Features.

  2. Right-click Microsoft SQL Server (Version) (Bit) and select Uninstall. For example, Microsoft SQL Server 2012 (64-bit).

    :::image type="content" source="media/uninstall-an-existing-instance-of-sql-server-setup/uninstall-sql-server-windows-2012.png" alt-text="Screenshot showing how to uninstall SQL Server.":::

  3. Select Remove on the SQL Server dialog pop-up to launch the Microsoft SQL Server installation wizard.

    :::image type="content" source="media/uninstall-an-existing-instance-of-sql-server-setup/remove-sql-2012.png" alt-text="Screenshot showing how to remove SQL Server.":::

  4. On the Select Instance page, use the dropdown list to specify an instance of [!INCLUDE ssNoVersion] to remove, or specify the option to remove only the [!INCLUDE ssNoVersion] shared features and management tools. To continue, select Next.

  5. On the Select Features page, specify the features to remove from the specified instance of [!INCLUDE ssNoVersion].

  6. On the Ready to Remove page, review the list of components and features that will be uninstalled. Select Remove to begin uninstalling

  7. Refresh the Programs and Features window to verify the SQL Server instance was removed successfully, and determine which, if any, SQL Server components still exist. Remove these components from this window as well, if you so choose.


In the event of failure

If the removal process fails, review the SQL Server Setup log files to determine the root cause.

Related content