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 72

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>


  • 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?
  • 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.
  • Thx did the trick for me!
  • 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.
  • 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
  • Thanks!
    I was beating my head against a wall untill I found this blog!
  • TO UNINSTULL ALL IN OR ONE PRODUCT IN YOUR PC (win) us http://support.microsoft.com/default.aspx?scid=kb;en-us;290301

    Windows Installer Clean Up
  • 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..:)
  • 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.


  • 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!
  • 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)

  • 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
  • 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.

  • 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.

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


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