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



The information in this article applies to:

  • Microsoft SQL Server 2000 (all editions)

This article was previously published under Q290991

SUMMARY

The steps in this article describe how you prepare your system for a reinstallation of the SQL Server program.

The correct way (and the way that Microsoft recommends you use) to remove Microsoft SQL Server 2000 is to use the Uninstall option that is available in the Microsoft SQL Server 2000 Setup program. However, if an installation fails, the Uninstall option may not be available. If the Uninstall option is not available, you must get the system to a clean, stable installation point before you try to reinstall the SQL Server program.

Note The Microsoft SQL Server 2000 (64-bit) setup program uses the Windows Installer to completely integrate the installation of SQL Server features in a single feature tree. The minimum and the typical installation modes are no longer implemented. By default, the Setup program displays the feature tree with all the available features selected. Administrators can customize an installation by selecting items on the feature tree and by changing installation paths. For more information, see the SQL Server 2000 (64-bit) documentation.

back to the top

Things to consider before you remove Microsoft SQL Server 2000

IMPORTANT WARNING: You may have databases that you want to save in their present state. You may also want to save changes that were made to the default databases. If either is true, before you follow the steps in this article, make sure that you have a known good backup of the data or that you save a copy of all the data and log files in a folder other than the MSSQL folder, because you must delete the MSSQL folder.

The files you must save include these database files that Microsoft SQL Server 2000 installs:
  • Distmdl.*
  • Master.*
  • Mastlog.*
  • Model.*
  • Modellog.*
  • Msdbdata.*
  • Msdblog.*
  • Northwnd.* (optional install)
  • Pubs.*
  • Pubs_log.*
  • Tempdb.*
  • Templog.*

Warning If the SQL Server installation is also being used in conjunction with Microsoft SQL Server Reporting Services, make sure that the following folders and the sub-folders are also saved or renamed:
  • Default path\Reporting Services
  • Default path\MSSQL\Reporting Services
  • Default path\SQL Server Instance name\Reporting Services
  • Default path\80\Tools\Report Designer
Note Default path refers to %ProgramFiles%\Microsoft SQL Server

Microsoft also recommends that:
  • You verify that no other cluster resources have dependencies on Microsoft SQL Server 2000, if Microsoft SQL Server 2000 is clustered.

    For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

    835185 Failover cluster resource dependencies in SQL Server

  • You stop Microsoft SQL Server 2000, because active connections can prevent the uninstall process from completing successfully.
  • You close all Microsoft SQL Server 2000 Client or Administration tools on other nodes.
  • You log onto the server with the Microsoft SQL Server 2000 service account or an account of equivalent privileges (that is, an account that is a member of the Local Administrator group). If SQL Server is clustered, the account you use must be a member of the Local Administrators group on all the cluster nodes.
back to the top

Steps to remove SQL Server

Important This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry


Warning If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.
Depending on your specific environment, you can use one, or more, of the steps that follow.

After you successfully remove SQL Server, you do not have to continue with the remaining steps in this list.

  1. For a virtual server, use the Microsoft SQL Server 2000 Setup program that is on the CD and click the Uninstall option. This is documented in the "How to uninstall an existing installation of SQL Server (Setup)" topic in SQL Server Books Online.
  2. For a non-clustered (stand-alone) instance, you can either follow step 1, or, in Control Panel open the Add/Remove Programs applet.
  3. In Control Panel, open the Add/Remove Programs applet.
  4. Run Regedt32, and then locate this registry key:

    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

    Under the Uninstall key, locate the product code for the instance of Microsoft SQL Server 2000 that you are trying to remove.

    On the Taskbar, click Start, and then click Run. In the Run dialog box, copy and paste, or type, this command:

    C:\WINNT\IsUninst.exe -f"C:\Program Files\Microsoft SQL Server\MSSQL$Server1\Uninst.is" -c"C:\Program Files\Microsoft SQL Server\MSSQL$Server1\sqlsun.dll" -Mssql.miff i=I1

    If these steps do not work, you can follow the steps in the Remove All Known Instances of SQL Server section to remove Microsoft SQL Server 2000 manually.

    Note It is not the intent to remove 100 percent of SQL Server 2000 at this time. These steps are intended to get the system to a state where you can perform a successful installation, so that you can then remove the Microsoft SQL Server 2000 installation that is being recovered.

  5. Locate the Data folder for your installation, and then rename it if you have to save the data. Otherwise, delete the Data folder. Microsoft recommends that you keep the Data folder so that you have a flat file backup of the databases in an MDF and LDF format available. If you rename the Data folder, you can recover the existing data in the same state and condition it was in when you took the instance of SQL Server offline, provided the re-installation uses the same name, path, and IP address.


Note If this is a clustered instance of SQL Server 2000, repeat these steps for each node in the cluster.

back to the top

Remove a specific instance of SQL Server

To remove a specific instance of SQL Server, follow these steps:
  1. Locate, and then delete the %drive%:\Program Files\Microsoft SQL Server\MSSQL\Binn folder where %drive% is the location of the instance of SQL Server you want to remove.
  2. Locate, the following registry key:
    • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer

      Note If you are deleting a default instance, you must delete all the keys EXCEPT the Client key.
    • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server

      You must use Regedt32.exe to edit the InstalledInstances value of the instance you are removing. A default instance is listed as MSSQLSERVER, and named instances appear as the name given to the instance.

      Note You cannot use Regedit.exe to edit the value; you must use Regedt32.exe instead.


Note If this is a clustered instance of SQL Server 2000, repeat these steps for each node in the cluster.

back to the top

Remove all known instances of SQL Server

To remove all known instances of SQL Server, follow these steps:
  1. Locate, and then delete the %drive%:\Program Files\Microsoft SQL Server\MSSQL\Binn folder.
  2. Locate, and then delete these registry keys:
    • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer
    • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server


  3. Locate, and then delete these registry keys:
    • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSQLServer
    • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SQLSERVERAGENT
    • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSQLServerADHelper
  4. The three registry keys in step 3 correspond to the default instance of Microsoft SQL Server 2000. Named instances appear similar to those listed in step 3, along with $instance_name, because instance_name is the name given to your particular instance. After you locate the correct keys for the instance you are removing, select those keys, and then delete them.
    • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSQLServer$InstanceName
    • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SQLSERVERAGENT$InstanceName
    • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSQLServerADHelper

  5. If the instance of SQL Server you are removing was clustered, remove any cluster resources for the instance that may remain in the Cluster Administrator.

    Note Only remove SQL Server resources.
  6. Reinstall Microsoft SQL Server 2000 and use the same name, and IP address.
  7. Run the Setup for the installation, and use the Uninstall option to clean up any configuration problems or errors that may still exist because of the failed installation.


Note If this is a clustered instance of SQL Server 2000, repeat these steps for each node in the cluster. back to the top

Remove a default instance of SQL Server

To remove a default instance of SQL Server locate, and then delete these registry keys:
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Search
  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSQLServer
  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SQLSERVERAGENT
back to the top

Remove a named instance of SQL Server

To remove a named instance of SQL Server, follow these steps:
  1. Locate, and then delete these registry keys for a Named Instance, where InstanceName is the name of the instance that you are removing.
    • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSQLServer$InstanceName
    • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SQLSERVERAGENT$InstanceName
  2. If the instance of SQL Server you are removing was clustered, remove any cluster resources for this instance of SQL Server that may remain in the Cluster Administrator.

    Note Only remove SQL Server resources.
  3. Reinstall Microsoft SQL Server 2000 and use the same name, and IP address.
  4. Run the Setup for the installation, and then use the Uninstall option to clean up any configuration problems or errors that may still exist because of the failed installation.


Note If this is a clustered instance of SQL Server 2000, repeat these steps for each node in the cluster. back to the top

How to include full-text removal

To include full-text removal, follow these steps:
  1. Delete the following registry entries . Only use this section when you use the steps in the Remove All Known Instances of SQL Server section:
    • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSCNTRS
    • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSEARCH
    • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSGATHERER
    • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSGTHRSVC
    • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSINDEX
    Note Deleting these registry keys disables the Microsoft Search service (MSSearch). This can affect the following applications if they are running on the same computer:
    • Microsoft Exchange Server
    • Microsoft SharePoint Portal Server
    • Microsoft Site Server
    • Microsoft Commerce Server
    • Microsoft Small Business Server
  2. If the instance of SQL Server you are removing was clustered, remove any cluster resources for this instance of SQL Server that might remain in the Cluster Administrator.

    Note: Only remove SQL Server resources.
  3. Reinstall Microsoft SQL Server 2000 and use the same name, and IP address.
If you do not remove MSSearch, you may receive the following error messages when you reinstall SQL Server 2000:

[sqlclusterSetup.cpp:464]: 2 (0x2): The system cannot find the file specified. Problem in the resource name SQL Server Fulltext.

[clushelp.cpp:1238]: 5007 (0x138f): The cluster resource could not be found.

[sqlclusterSetup.cpp:1059]: 5007 (0x138f): The cluster resource could not be found.


If you receive these error messages, restart your servers, follow the steps to remove MSSearch, and then try the installation again.

Note: Because the removal process did not complete previously, if you are concerned about being able to remove an instance in the future, you can perform the following step to verify that you have resolved all the issues that can cause a recurrence of this problem. You do not have to perform this step just to make sure that this particular removal completed; it only checks whether the automatic removal process is working. Run the SQL Server Setup program and use the Uninstall option to verify the removal process now instead of waiting until you must have this functionality. If this step fails, you must continue to investigate to determine and resolve the cause of the failure.

Run Setup for the installation, and then use the Uninstall option to verify that there are no configuration problems or errors that may still exist because of the failed removal.

Note: In some cases, the folder %drive%:"\Program Files\Microsoft SQL Server\80 may not be deleted, and you must manually delete the folder.

When you reinstall SQL Server 2000, the following error message may occur:
A previous program installation created pending file operations on the installation machine. You must restart the computer before running setup
If the error message occurs, restart your servers, and then try the installation again. If you receive the error message again, after you restart the server, the files you are trying to delete are probably Read-only.

Follow these steps to see if the files are Read-only:
  1. Locate this registry key:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\PendingFileRenameOperations

  2. Note the file names.
  3. Verify that those files do not have the Read-only attribute set.
  4. Restart the server again.
back to the top

Delete contents of Temp folders before you reinstall SQL Server

Delete all contents from the Temp folder of both the System Temp and the Temp folder of the installing user. To determine the location of the Temp folder for the user, type the following command at a command prompt:

C:\Documents and Settings\username>set t

The results should include the following:
TEMP=C:\DOCUME~1\username\LOCALS~1\Temp
TMP=C:\DOCUME~1\username\LOCALS~1\Temp
Other items may also be listed. The typical path is the following:

C:\Documents and Settings\username\Local Settings\Temp

The typical path for the System Temp path is %systemroot%\temp. back to the top

REFERENCES

If the pending file operations error message persists, see the following article in the Microsoft Knowledge Base:

312995 SQL Server 2000 installation fails with "...previous program installation..." error message

back to the top

Modification Type:MajorLast Reviewed:9/16/2004
Keywords:kbHOWTOmaster KB290991 kbAudDeveloper kbAudITPro