Welcome to MSDN Blogs Sign in | Join | Help

How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

I have heard from a few customers (inside and outside of Microsoft) who have had problems uninstalling previous beta versions of SQL Express via Add/Remove Programs or via the cleanup tools we have released (located here and here).  These customers have seen unexpected errors in the datastore related to the actions named RestoreSetupParams and/or Write_CommitFlag.  The exact error message states that setup is unable to write property into the cache: IsClustered and unable to write property into the cache: flagCommit.

The error messages look similar to the following:

SQL Express Uninstall Error 1

SQL Express Uninstall Error 2

I haven't narrowed down the exact sequence, but these uninstall errors are caused by uninstalling beta versions of SQL 2005 and/or VS 2005 in specific orders.  The officially recommended uninstall order for these products can be found at this location.  However, this order is not enforced via the Add/Remove Programs control panel and it is pretty easy to overlook the readme and uninstall in alphabetical order or some other random order and get into this state.

If you encounter either or both of the above error dialogs, you can use the following steps to resolve the errors:

  1. Download and run msiinv.exe using the instructions in this previous blog post
  2. Look at the output from msiinv.exe in a text editor such as notepad and locate each of the products that are installed that have SQL 2005 in the name
  3. Click on the Start menu, choose Run and type cmd
  4. For each of the SQL 2005 product codes found in the msiinv.exe output, run msiexec /x {Product Code} from the cmd prompt - this command will likely generate the same errors shown above but it is good to run it just in case
  5. Download the smartmsizap tool
  6. For each of the SQL 2005 product codes found in the msiinv.exe output, run smartmsizap.exe /p {Product Code} from the cmd prompt

After running smartmsizap to cleanup each of the SQL 2005 products left behind on your machine, you should be able to successfully install later builds of SQL Express and/or VS 2005.

<update date="11/26/2005"> Added text descriptions of the error messages to make it more likely that this blog post will be found from internet search engines because I have heard from a lot of customers who have run into this error but not found this blog post. Also modified the uninstall instructions to use the smartmsizap tool that I had not yet written at the time that I originally wrote this blog post. </update>

 

Published Tuesday, September 13, 2005 9:25 PM by astebner

Comments

Thursday, October 06, 2005 5:26 PM by Kylir Horton

# Still unable to install SQL Server 2005 Express CTP

I screwed up while uninstalling Visual Studio and uninstalled its files in the wrong order. Upon trying to reinstall it, I got the same message that you included the screen shot for. So, I did what you recommended and now when I try to install Visual Studio SQL Server Express fails to install. Do you have any recommendations on how to proceed?
Tuesday, October 11, 2005 2:46 AM by astebner

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

Hi Kylir - could you please send me the output from when you ran msiinv.exe on your computer and also send me the SQL setup log files from your most recent installation attempt? They will be located in %programfiles%\Microsoft SQL Server\90\Setup Bootstrap\Log\Files\*.*

You can send them to aaronste (at) microsoft (dot) com or use the contact link at http://blogs.msdn.com/astebner/contact.aspx and I can reply to that.
Tuesday, November 01, 2005 5:24 AM by Coen Roos

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

Thx did the trick for me!
Wednesday, November 09, 2005 3:00 PM by Help Desk

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

This helped me out greatly. I could not get the SQL tools installed because it kept coming back saying that I had some "Local" setting turned on and a piece of the software already installed. I ran through this uninstall process and it worked right off the bat! Thanks. I love these MS blogs. Keep up the GREAT work.
Thursday, November 10, 2005 10:56 PM by Colin Sanson

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

Thanks it solved my problems uninstalling the beta version of SQL Server 2005 Express. The first sign of trouble was an error message about writing to C:\Documents and Settings\Username\Temp. This meant that SQL Server components where still on my system, however it no longer appeared in the Add/Remove programs list
Sunday, November 20, 2005 7:44 PM by Alex

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

Thanks!
I was beating my head against a wall untill I found this blog!
Sunday, November 27, 2005 11:21 PM by filip

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

Saturday, December 10, 2005 5:41 PM by Carriat

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

Wow...!!..what a genious...thx a lot..this really helped me..not only to uninstall beta versions of SQlExpress..else..to delete files that I thought were gone a loooong time ago (VS 2003 :S:S:S)....Thx..:)
Monday, December 26, 2005 12:24 PM by Lisa Shanley

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

Hi,

I am truly stumped and in need of help. I have been trying to install SQL Server Express all weekend. I had removed previous versions correctly as directed. When I first tried to install SQL Server Express, I got both of the error messages above. I ran MSIINV to get the product code. I only found one product code related to SQL. I ran SmartMSIZap with that product code. After that, on bootup, I got the error message that my SQL Server installation was either correct or had been tampered with and that SQLBoot.dll could not be loaded. I disbled all services related to SQL Server and that stopped the error message. I then ran Windows Installer Clean Up and removed 4 items for SQL. I still get a failed installation though. Visual Basic Express 2005 installed and is running just fine.

Can you please help? Thanks.

Lisa

Monday, December 26, 2005 1:12 PM by todd

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails



Hello,

I try to run smartmsizap.exe /p {my product code} but i receive the following message:

'smartmsizap.exe' is not recognized as an internal or external command,
operable program or batch file.


Just not use to using the cmd prompt. thanks for your help!
Monday, December 26, 2005 11:42 PM by astebner

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

Hi Lisa - can you please zip and send me the log files located at %ProgramFiles%\Microsoft SQL Server\90\Setup Bootstrap\Log\Files so I can take a look and see if I can figure out why SQL setup is failing for you? You can send them to aaronste@microsoft.com

Hi Todd - in order to run smartmsizap.exe from a cmd prompt you will need to do the following:

1. Click on the Start menu, choose Run and type cmd

2. Type cd /d <directory name that you saved smartmsizap.exe to> (where you substitute the actual directory where you saved smartmsizap.exe to, such as c:\temp)

3. Type smartmsizap.exe /p {my product code} (where you substitute the actual product code you want to remove in this command)

Tuesday, December 27, 2005 2:27 PM by Todd

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

Thanks very much Aaron. I followed your instructions above but nothing seemed to happen. When I entered the commands no errors appeared but no events happened. I tired reinstalling Visual Developer and again SQL Express failed to install.

Any insight? Thanks again. --Todd
Tuesday, December 27, 2005 10:31 PM by astebner

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

Hi Todd - The smartmsizap tool does not present any UI if it works successfully (which I need to fix to make it easier to use), but the lack of a message does not mean that no events happened. You can check in the log file %temp%\smartmsizap.log to see what happened.

If the install is still failing, you might have other beta products still installed, or there might be some other problem. Can you send me the SQL log files (located at %ProgramFiles%\Microsoft SQL Server\90\Setup Bootstrap\Log\Files) and an updated output report from msiinv.exe so I can take a look and try to figure out what is going on with your scenario? You can send them to aaronste@microsoft.com.

Wednesday, December 28, 2005 12:04 AM by astebner

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

For other folks reading this - I received log files from Lisa from her SQL Express setup failure and I found the following error message:

Error 28086. An instance with the same name is already installed on this computer. To proceed with SQL Server Setup, provide a unique instance name.

The steps listed at http://blogs.msdn.com/astebner/archive/2005/12/08/501885.aspx allowed her to clean up the orphaned instance name and successfully install SQL Server Express 2005.

Wednesday, December 28, 2005 11:07 AM by Gabhan

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

Thanks for the tips. Got my SQL Betas removed and SQLExpress installed and running nicely..

Cheers,

Gabhan
Saturday, January 07, 2006 10:18 AM by lance

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

this worked fine for removing SQL server express edition from the MSI database. It's no longer seen as an installed application but the SQL services are still installed on my machine and the source files still exist. So now what should be done?
Sunday, January 08, 2006 10:17 PM by astebner

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

Hi Lance,

You can do the following to remove the SQL services from your system:

1. Click on the Start menu, choose Run and type cmd

2. Run the command sc delete <service_name> for each SQL 2005 service still on your system

3. Remove orphaned SQL instances by using the steps located at http://blogs.msdn.com/astebner/archive/2005/12/08/501885.aspx

4. Remove orphaned SQL 2005 files if desired (but I haven't seen this being necesary because installing the final release of SQL 2005 will replace the beta files)

5. Try to install the final release of SQL 2005

Hope this helps!
Friday, January 13, 2006 10:06 PM by David

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

thanks a lot !
Sunday, February 19, 2006 9:52 PM by Satya

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

I followed the msiinv.exe advise and after I installed the SQL Express, I keep getting the message that SQLExpress installation has failed. A closer look at the files in the ..\80 and ..\90 folder show most files are not present. I'm at my wits end as to how to solve this problem. Dont know how to find which entries in the registry are affecting me or for that matter what is the problem. Can anyone help?
Sunday, February 19, 2006 11:49 PM by astebner

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

Hi Satya - SQL Express setup creates log files at %ProgramFiles%\Microsoft SQL Server\90\Setup Bootstrap\Log\Files that should help figure out why the installation failed.  You might be running into the issue described at http://blogs.msdn.com/astebner/archive/2005/12/08/501885.aspx but it is hard to say for sure without looking at the log files.  If possible, please contact me using http://blogs.msdn.com/astebner/contact.aspx and send me the log files from that folder so I can try to take a quick look and see if I can figure out why SQL setup is failing for you in this scenario.
Monday, February 20, 2006 12:11 PM by Jorge

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

I have downloaded your tool "Visual Studio 2005" and after processing I get the message:
"The following task did not complete successfully:
Uninstall Visual Studio components "
What else can I do to remove the beta version of sql express?

Monday, February 20, 2006 12:21 PM by astebner

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

Hi Jorge - You can also use the steps listed at http://blogs.msdn.com/astebner/archive/2005/10/30/487096.aspx to locate and manually remove any remaining beta components on your system.
Wednesday, March 22, 2006 10:31 PM by derek

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

http://blogs.msdn.com/astebner/archive/2005/10/30/487096.aspx is dead, Server Error in '/' Application.  Nice.
Wednesday, March 22, 2006 10:42 PM by astebner

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

Hi Derek - It appears that there was a temporary hiccup on the blog server.  That link is working fine for me now.  Can you please try again and see if it works for you?
Thursday, March 23, 2006 2:18 PM by Jay Connaughton

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

i have tried this but i still get the error message you see above when i try to install via the microsoft unistall. and when i try to put the new sql on my computer i still get the message detecting a previous install.

any thoughts?
Friday, March 24, 2006 2:25 AM by astebner

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

Hi Jay - Could you please contact me via http://blogs.msdn.com/astebner/contact.aspx and provide an updated list of installed programs that you gather with the msiinv.exe tool (produced in step 1 of the instructions on this blog post).
Thursday, April 20, 2006 1:38 PM by spencer

# where is the msiinv.exe output file?

when I run msiinv.exe I don't seem to get an output file anywhere.  I'm running it from the desktop b/c when I run it from cmd it tells me it's not a valid command.

thanks for the help!
Thursday, April 20, 2006 2:08 PM by astebner

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

Hi Spencer - You have to run msiinv.exe from a cmd prompt in order to be able to redirect the output to a text file.  You should be able to do the following:

1. Click on the Start menu, choose Run and type cmd

2. In the cmd window, change directories to the path where you saved msiinv.exe to

3.  Run msiinv.exe > c:\output.txt or some other file name

The greater than (>) sign causes output to be sent to a file instead of to the cmd console window.
Tuesday, April 25, 2006 10:44 AM by Jacob Pettersson

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

This guide helped me greatly!!!!!!

Was seconds from formatting (or throwing the computer out the window)
Tuesday, May 16, 2006 7:42 PM by David M. Bennett

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

Hi,

When I run the following command:

Run msiinv.exe > c:\output.txt

I then look for but find no file named output.txt in the c: drive.

So I created a blank text file with the same name above at the expected location, run msiinv.exe again and then open the file to find it is still empty.

What am I missing here?
Wednesday, May 17, 2006 1:17 PM by astebner

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

Hi David - Where did you save msiinv.exe to on your local system and are you running the command line from the exact folder that you saved it to?  Also, just to double-check, did you unzip the msiinv.zip to extract the EXE?  Finally, are you launching a cmd prompt and running it from there?  The command line will not create the log file if you try to run it from the Start menu Run box.

The exact steps you need to follow to run msiinv are the following:

1.  Download msiinv.zip from http://www.huydao.net/setup/msiinv.zip

2.  Extract the file msiinv.exe from the ZIP file and save it to your local hard drive

3.  Click on the Start menu, choose Run and type cmd

4.  In the cmd window, change directories to the folder you saved msiinv.exe to by typing cd /d <folder>.  For example, if you saved it to c:\temp, type cd /d c:\temp

5.  Type msiinv.exe > c:\output.txt

Hopefully this helps...
Wednesday, May 17, 2006 4:10 PM by David M. Bennett

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

Thanks, didn't know we could not run from the Start Menue Run Box.

Anyway, did so with 'some?' success. Got this error after running msiinv.exe "Unexpected error: 1605 ()" in the Dos Window.

The output.txt file contained info on the SQL beta program so I ran the smartmsizap tool to remove it.  

However, during the install of SQL 2005 Express I got the error msg: "SQL Server 2005 setup has detected incompatible components from beta versions of ...." as before.

Not sure what to do.  I'll try all over again.
Wednesday, May 17, 2006 4:43 PM by astebner

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

Hi David - there are several sub-products that are a part of SQL 2005, so you need to make sure you look for all of them in your msiinv output and remove them all.  You can find a complete list of SQL Express 2005 products that will need to be removed at http://msdn.microsoft.com/vstudio/support/uninstall/default.aspx.
Thursday, May 25, 2006 8:24 AM by Walimay

# ot an error installing SQL express

Hi,
I got an error while installing SQL XPress full (with managemento tools, 234 Mb executable) saying me that some component (workstation component ) are already installed and the setup stops.
How can I get out from this tunnel ? I've already removed all sql references from add remove programs and also all the folders created by setup.
pls help me !

tnx Walimay.
Sunday, May 28, 2006 3:26 PM by astebner

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

Hi Walimay - I have not heard of this particular error before, so I am not sure the best steps to recommend for you to try.  You may want to search on the MSDN Forums (http://forums.microsoft.com) for advice from other customers who might have hit similar issues.  You may also want to try the steps at http://blogs.msdn.com/astebner/archive/2005/10/30/487096.aspx to locate and manually remove any remaining SQL 2005 products on your system and see if that helps.
Tuesday, June 13, 2006 9:34 AM by Wiles

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

Thank you so much for this information! I have been trying for months to get the Beta stuff of my system so I could get plain old SQL Server 2000 to install. This did the trick!

# Aaron Stebner's WebLog : Visual Studio 2005 and .NET Framework 2.0 Setup Troubleshooting Guide

Wednesday, July 26, 2006 6:38 AM by dananos

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

When I try to uninstall SQL express, it comes up with ".NET framework 2.0" is not installed - but it is?

Any ideas?
Sunday, July 30, 2006 3:35 PM by astebner

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

Hi Dananos - I would suggest repairing the .NET Framework 2.0 just to make sure it is working correctly and then trying to uninstall again.  If that doesn't help, I suggest using the manual removal steps at the top of this blog post.  Hope this helps...
Wednesday, August 23, 2006 3:58 PM by johnmabbott

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

I had been struggling for weeks until I found your blog today. I had previously istalled both the CTP and visual Studio 2005 beta.  I followed your instructions above and installation proceeded much further but still failed.  I then found your previous blog and manually cleaned the registry hives.  Hey presto, success!

many thanks
Friday, September 15, 2006 3:22 AM by Clean up a SQL 2005 instance name « Techlogs

# Clean up a SQL 2005 instance name &laquo; Techlogs

Wednesday, November 22, 2006 1:46 AM by sriki38

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

Awesome!! Thanks a lot for all the help!

It worked! i was stuck with this problem for 2 weeks on my production machine!!

Thanks Again!

-Srikanth

Friday, February 16, 2007 9:34 PM by Aaron Stebner's WebLog

# Visual Studio 2005 and .NET Framework 2.0 Setup Troubleshooting Guide

Where to get Visual Studio 2005 and the .NET Framework 2.0 Where to download the .NET Framework 2.0 redistributable

Tuesday, July 10, 2007 6:00 AM by Simon Phillips

# Uninstalling Applications that do not appear in the Add / Remove Program

I recently instaled an appliaction (Laptop version of CRM Client which installed an instance of MS SQL

# Sonicwall Viewpoint 4.1 Installation Error: SQL Server does not exist or access denied &laquo; the back room tech

Monday, February 11, 2008 5:30 PM by pardhac

# re: How to manually uninstall SQL Express if uninstalling from Add/Remove Programs fails

Thank you so much for this information! I have been trying for couple of days to get the Express stuff off my system so I could load SQL Server 2005 to install. This blog helped me lot.

- Pardha

Anonymous comments are disabled
 
Page view tracker