Microsoft KB Archive/909967

= How to uninstall an instance of SQL Server 2005 manually =

Article ID: 909967

Article Last Modified on 11/20/2007

-

APPLIES TO


 * Microsoft SQL Server 2005 Standard Edition
 * Microsoft SQL Server 2005 Standard X64 Edition
 * Microsoft SQL Server 2005 Standard Edition for Itanium-based Systems
 * Microsoft SQL Server 2005 Enterprise Edition
 * Microsoft SQL Server 2005 Enterprise X64 Edition
 * Microsoft SQL Server 2005 Enterprise Edition for Itanium-based Systems
 * Microsoft SQL Server 2005 Developer Edition
 * Microsoft SQL Server 2005 Express Edition

-



Important This article contains information about how to modify the registry. Make sure to back up the registry before you modify it. Make sure that you know how to restore the registry if a problem occurs. For more information about how to back up, restore, and modify the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows registry



INTRODUCTION
This article describes how to uninstall a stand-alone instance of Microsoft SQL Server 2005 manually. If you follow the steps in this article, you prepare the system so that you can reinstall SQL Server.

For more information about how to uninstall a SQL Server 2005 failover cluster manually, see the &quot;How to manually uninstall a SQL Server 2005 failover cluster&quot; topic in SQL Server 2005 Books Online, or visit the following Microsoft Developer Network (MSDN) Web site:

http://msdn2.microsoft.com/en-us/library/ms180973(SQL.90).aspx

For more information about how to uninstall an instance of SQL Server 2000 manually, click the following article number to view the article in the Microsoft Knowledge Base:

290991 How to manually remove SQL Server 2000 default, named, or virtual instance

Important On a computer that is running SQL Server 2005 together with earlier versions of SQL Server, SQL Server Enterprise Manager and other programs that depend on SQL-DMO may be disabled when you uninstall the instance of SQL Server 2005.

This issue may occur when you have side-by-side installations of SQL Server 2005, SQL Server 2000, and SQL Server 7.0 and when you uninstall any one of the versions. This issue may also occur when you have side-by-side installations of SQL Server 2000 and SQL Server 2005 and when you installed SQL Server 2000 after you installed SQL Server 2005.

This issue occurs because the registration for the SQL Server 2005 SQL-DMO COM library was deleted. To re-enable SQL Server Enterprise Manager and other programs that depend on SQL-DMO, register SQL-DMO. To do this, run the following command at a command prompt:

regsvr32.exe sqldmo.dll



MORE INFORMATION
We recommend that you use Add or Remove Programs to uninstall SQL Server 2005. However, if an installation fails or if Add or Remove Programs does not uninstall the instance of SQL Server 2005, follow the steps in this article to uninstall the instance manually.

If you receive the following error message during the SQL Server 2005 Setup process, a SQL Server 2005 component was not uninstalled from the computer:

A component that you have specified in the ADD_LOCAL property is already installed. To upgrade the existing component, refer to the template.ini and set the UPGRADE property to the name of the component.

Back up the data
You may have databases that you want to save in the present state. You may also want to save changes that were made to the default databases. If either case is true, make sure that you have a good backup of the data before you follow the steps in this article. Alternatively, save a copy of all the data and of all the log files. Save these copies in a folder other than the MSSQL folder. The MSSQL folder is deleted as part of the uninstallation process.

The files that you must save include the following database files. These files are installed as part of SQL Server 2005:
 * Distmdl.
 * Master.
 * Mastlog.
 * Model.
 * Modellog.
 * Msdbdata.
 * Msdblog.
 * Mssqlsystemresource.
 * Northwnd. (This database is an optional installation.)
 * Pubs.
 * Pubs_log.
 * Tempdb.
 * Templog.
 * ReportServer[$ ] (This is the Report Server default database.)
 * ReportServer[$ ]TempDB (This is the Report Server default temporary database.)

Delete the local security groups
As part of the uninstallation process, delete the local security groups for the SQL Server 2005 components. For more information, see the &quot;Setting up Windows service accounts&quot; topic in SQL Server 2005 Books Online, or visit the following MSDN Web site:

http://msdn2.microsoft.com/en-us/library/ms143504.aspx

Save or rename the SQL Server Reporting Services folders
If you use the SQL Server installation together with SQL Server Reporting Services, save or rename the following folders and subfolders:
 * \Reporting Services
 * \MSSQL\Reporting Services
 * \ \Reporting Services
 * \90\Tools\Reporting Services

Note  is a placeholder for %ProgramFiles%\Microsoft SQL Server. If you used the Reporting Services Configuration tool to configure the installation, the names may differ from the names in this list. Additionally, the databases may be located on a remote computer that is running SQL Server.

Stop all SQL Server services
We recommend that you stop all SQL Server services before you uninstall the SQL Server 2005 components. Active connections may prevent the uninstallation process from finishing successfully.

Use an account that has the required rights
Log on to the server by using the SQL Server 2005 service account or by using an account that has equivalent rights. For example, log on to the server by using an account that is a member of the local Administrators group.

How to uninstall a stand-alone instance of SQL Server 2005 manually
Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall your operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.

Step 1: Make sure that the Microsoft SQL Server Setup Support Files component is installed
In Add or Remove Programs, make sure that Microsoft SQL Server Setup Support Files appears in the list of installed programs. If Microsoft SQL Server Setup Support Files appears in the list, go to the &quot;Step 2: Run the command to uninstall the SQL Server components&quot; section.

If Microsoft SQL Server Setup Support Files does not appear in the list, install this component before you continue. To install this component, follow these steps:
 * 1) Locate the original SQL Server 2005 installation media.
 * 2) To install the support files, double-click the Servers\setup\sqlsupport.msi file.

Note In the &quot;Step 5: Uninstall the Microsoft SQL Server Setup Support Files component&quot; section, you uninstall this component.

Step 2: Run the command to uninstall the SQL Server components
At a command prompt, run the following command:

&quot;%ProgramFiles%\Microsoft SQL Server\90\Setup Bootstrap\ARPWrapper.exe /Remove&quot;

Uninstall the SQL Server components one at a time until all the SQL Server components are uninstalled.

Note Add or Remove Programs also runs the ARPWrapper.exe program by using the /Remove option. However, the reference to the ARPWrapper.exe program may have been deleted.

If you have uninstalled SQL Server Reporting Services, you must perform the following tasks:  ===== Delete the Reporting Services virtual directories =====

Use Microsoft Internet Information Services (IIS) Manager to delete the following virtual directories:  ReportServer[$  Reports[$   ===== Delete the ReportServer application pool =====

Use IIS Manager to delete the ReportServer application pool. 

If you receive the following error message, go to the &quot;If you experience problems&quot; section to uninstall the SQL Server redistributed files and the SQL Server support files:

Registry Enumeration Failed

You may have an instance that has more than one server. For example, you may have an instance that has SQL Server 2005 Database Engine, SQL Server 2005 Analysis Services, and SQL Server 2005 Reporting Services. If you have an instance that has more than one server, the Setup program fails, and you receive the following error message:

The setup has encountered an unexpected error in datastore. The action is RestoreSetupParams.

This error is expected because of refcounting. A refcount is used to track how many programs use the same .dll file or the same .msi file. When a program is uninstalled, the program decrements the refcount for an .msi file by one. When the last program is uninstalled, the .msi file is deleted. In this case, the .msi file is the Microsoft SQL Server Setup Support Files component (SqlSupport.msi). If you receive this error message, use one of the following methods to resolve this error:  Reinstall the Microsoft SQL Server Setup Support Files component (SqlSupport.msi) before you uninstall each component in the instance.</li> Temporarily refcount the SqlSupport.msi file to itself. To do this, follow these steps: <ol> Obtain the GUID for the Microsoft SQL Server Setup Support Files component. To obtain the GUID, follow steps 1 and 2 from the &quot;If you experience problems&quot; section.</li> Use Registry Editor to create or to modify the following registry key with these values:

Key Name:

Value: Uninstall

Type: REG_SZ

Data: {11111111-1111-1111-1111-111111111111},{ }

Note  is a placeholder for the GUID of the SQL Server support files. For example, the GUID of the English x86 SQL Server support files is as follows:

Data: {11111111-1111-1111-1111-111111111111},{53F5C3EE-05ED-4830-994B-50B2F0D50FCE}

</li></ol> </li></ul>

If you experience problems
If you experience problems when you try to uninstall the SQL Server components, follow these steps: <ol> Start Registry Editor, and then locate the following registry key:

</li> In the left pane, click each GUID. For each GUID that you click, look for a display name in the right pane that includes &quot;Microsoft SQL Server 2005.&quot; For example, look for the following names:  Microsoft SQL Server 2005</li> Microsoft SQL Server 2005 Analysis Services</li> Microsoft SQL Server 2005 Reporting Services</li> Microsoft SQL Server 2005 Notification Services</li> Microsoft SQL Server 2005 Integration Services</li> Microsoft SQL Server 2005 Tools</li> Microsoft SQL Server 2005 Books Online</li></ul>

When you see a display name that includes &quot;Microsoft SQL Server 2005,&quot; note the GUID that you clicked in the left pane.</li> For each GUID that you noted in step 2, run the following command at a command prompt:

start /wait msiexec /x { } /l*v c:\sql_uninstall.log

Notes  <li>In this command, replace  with the GUID that you noted in step 2.</li> <li>If you receive the following error message, contact Microsoft Customer Support Services:

The setup has encountered an unexpected error in datastore.

For a complete list of Microsoft Product Support Services telephone numbers and for information about support costs, visit the following Microsoft Web site:

http://support.microsoft.com/contactus/?ws=support

</li></ul> </li> <li> Open the following file:

C:\Sql_uninstall.log

Approximately 15 lines from the bottom of the file, locate a line that resembles the following line: <pre class="fixed_text">MSI (s) (EC:F8) [12:52:18:007]: Product: Microsoft SQL Server 2005 Tools -- Removal completed successfully. If the uninstallation process was not successful, note the component name and the GUID, and then save the Sql_uninstall.log file. </li></ol>

Step 3: Uninstall the support components
Use Add or Remove Programs to uninstall the support components in the following order:
 * MSXML 6.0 Parser
 * SQLXML4
 * Microsoft SQL Server VSS Writer
 * Microsoft SQL Server 2005 Backward Compatibility
 * Anything else that is related to SQL Server 2005, except for the Microsoft SQL Server Native Client component and for the Microsoft SQL Server Setup Support Files component

If the uninstallation process fails for any one of the support components, you may receive the following error message:

Setup failed due to missing prerequisites

If you receive this error message, follow these steps: <ol> <li>Start Registry Editor, and then locate the following registry key:

</li> <li>In the left pane, click each GUID. For each GUID that you click, look for a display name in the right pane that matches the name of the redistributable file. When you see a display name that matches the name of the redistributable file, note the GUID that you clicked in the left pane.</li> <li>For each GUID that you noted in step 2, run the following command at a command prompt:

start /wait msiexec /x { } SKIPREDISTPREREQS=1 /l*v c:\sqlredist_uninstall.log

Note In this command, replace  with the GUID that you noted in step 2.</li> <li> Open the following file:

C:\Sqlredist_uninstall.log

At the bottom of the file, locate a line that resembles the following line: <pre class="fixed_text">MSI (s) (EC:F8) [12:52:18:007]: Product: Microsoft SQL Server 2005 Backward compatibility -- Removal completed successfully. If the uninstallation process was not successful, note the component name and the GUID, and then save the Sqlredist_uninstall.log file. </li></ol>

Step 4: Uninstall the Microsoft SQL Server Native Client component
If all the other steps were successful, uninstall the Microsoft SQL Server Native Client component by using Add or Remove Programs.

Note Do not uninstall the Microsoft SQL Server Native Client component if you have SQL Server 2000 components installed.

Step 5: Uninstall the Microsoft SQL Server Setup Support Files component
If all the other steps were successful, uninstall the Microsoft SQL Server Setup Support Files component by using Add or Remove Programs.

If these steps did not uninstall all the components
If the previous steps did not uninstall all the components, follow these steps: <ol> <li>Perform Step 1 in the &quot;How to uninstall a stand-alone instance of SQL Server 2005 manually&quot; section.</li> <li>In Add or Remove Programs, uninstall all SQL Server 2005 components in the following order: <ul> <li>SQL Server 2005</li> <li>SQL Server 2005 Analysis Services</li> <li>SQL Server 2005 Reporting Services</li> <li>SQL Server 2005 Notification Services</li> <li>SQL Server 2005 Integration Services</li> <li>SQL Server 2005 Tools</li> <li>SQL Server 2005 Books Online</li> <li>MSXML 6.0 Parser</li> <li>SQLXML4</li> <li>SQL Server VSS Writer</li> <li>SQL Server 2005 Backward Compatibility</li> <li>Anything else that is related to SQL Server 2005</li> <li>SQL Server Native Client</li> <li>SQL Server setup support files</li></ul> </li> <li>Download and then install the Windows Installer CleanUp Utility. For more information about this utility, click the following article number to view the article in the Microsoft Knowledge Base:

290301 Description of the Windows Installer CleanUp Utility

</li> <li>Start the Windows Installer CleanUp Utility.</li> <li>If any of the components in step 2 are listed, follow these steps: <ol style="list-style-type: lower-alpha;"> <li>Select the components, and then click Remove. You can use the CTRL key to select multiple components.</li> <li>When you receive the following warning message, click OK:

All products selected will be removed from the Windows Installer database. In order for the products to work properly, you must individually re-install all products selected.

Note Before you click OK, verify that the components that you selected are correct. These components will be permanently removed after you click OK.</li> <li>In Add or Remove Programs, uninstall the Windows Installer Cleanup Utility.</li></ol> </li></ol>

If these steps did not uninstall all the components and all the files that are related to the instance of SQL Server 2005, contact Microsoft Customer Support Services.

Additional query words: uninstall remove manual

Keywords: kbinfo kbtshoot kbexpertiseadvanced kbexpertiseinter kbsql2005setup KB909967

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.