Aaron Stebner's WebLog

Thoughts about setup and deployment issues, WiX, XNA, the .NET Framework and Visual Studio

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

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

Rate This
  • Comments 70

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.

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>

<update date="4/14/2009"> Fixed broken link to the smartmsizap tool and removed broken image links. </update>

<update date="8/27/2010"> Fixed broken link to the VS 2005 uninstall instructions and the TTool.zip tool. </update>


  • 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...
  • 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.
  • 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.
  • 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.
  • 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.
  • 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!
  • PingBack from http://blogs.msdn.com/astebner/articles/492809.aspx
  • When I try to uninstall SQL express, it comes up with ".NET framework 2.0" is not installed - but it is?

    Any ideas?
  • 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...
  • 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
  • PingBack from http://hkmicc.wordpress.com/2006/09/15/clean-up-a-sql-2005-instance-name/
  • 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!


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

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

  • PingBack from http://thebackroomtech.wordpress.com/2007/11/13/sonicwall-viewpoint-41-installation-error-sql-server-does-not-exist-or-access-denied/

Page 3 of 5 (70 items) 12345
Leave a Comment
  • Please add 5 and 3 and type the answer here:
  • Post