First, here are the recommended steps to manually uninstall SQL 2005:
http://support.microsoft.com/kb/909967
If that doesn't work, this is how you can manually uninstall all versions of SQL 2005 so that SQL can be reinstalled: .
Note - This method will delete all databases and configuration, you must have a backup of your existing SQL databases (which this uninstall will delete) before proceeding. (Again, this is not supported, please call Microsoft PSS for supported methods)
- Uninstall all SQL components possible in Add/Remove Programs (including the SQL client and VSS writer)
- Stop all SQL Services and configure them to disabled using Start > SQL Configuration Manager
- Delete the following registry to get rid of the services. If you have multiple instance installed, it will be Keyname$Instance (i.e. MSSQLServer$OFFICESERVERS)
- HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSQLServer
- HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SQLServerAgent
- HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSQLServerADHelper
- HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\ReportServer
- Verify that the services do not exist in the SQL Configuration Manager.
- Delete the SQL Configuration in the registry
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer
- HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server
- Note - if you installed a 32 bit version of SQL on 64 bit version of Windows, you will need to also delete them from the 32 bit registry node that is redirected. More Info MS 896459.
* HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432node\Microsoft\MSSQLServer
* HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432node\Microsoft\Microsoft SQL Server
- Delete the SQL Program files - Note this will also delete the existing databases on the system that must be restored from backup.
- Delete the directory: C:\Program Files\Microsoft SQL Server
Note - if you installed a 32 bit version of SQL on 64 bit version of Windows, you will need to also delete them from the 32 bit program files:
C:\Program Files (x86)\Microsoft SQL Server - You might need to reboot to close all files before you can delete the directory.
- Delete the directory: C:\Program Files\Microsoft SQL Server
Now you can reinstall a clean 32 bit or 64 bit SQL without errors.