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>


  • 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

  • PingBack from http://www.hilpers.com/1030546-vs-2005-installieren

  • PingBack from http://www.bsmsoft.com/911Error/?p=1

  • Hey Aaron~

    It works for me! I was able to uninstall all the SQL Server 2008s except the Setup one which is 570+ megabytes. I use the same method you suggested but when I checked the list of installed software, it is still there.

    Any suggestions will be appreciated.


  • Hi BobV - The steps in this blog post are not a replacement for the normal uninstall process.  They are intended to unblock the uninstall if you are trying to remove + re-install SQL Server.  There are a couple of options you could use if you need to remove the items from the list of installed software:

    1.  Manually remove the registry entries that are used to display items in this list.  They are located under HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall in your registry.


    2.  Re-install SQL Server, and then use the normal uninstall process to remove it.

  • Thanks a ton... This post has helped me immensely... Keep up the good work... Thanks once again...

  • Thank's for all the advices. But it would be more usefull if Microsoft could produce some solid software, without conflicting at every step. I am "using" SQL Express 2005 because it is required by a process simulation software and must install SQL before starting the simulator installation. Microsft owes me two days in this weekend plus a present for my wife.

  • Thanks man! Awesome fix. The registry key delete that so many others promote did not work for me! Your fix did! Kudos!

  • Thx! It Solved the priblem, awesome fix !

  • Unfortunately, I have encountered a problem.

    Here are the screenshots of what I did, and the outcome.

    Putting in the command;




  • Hi SwerveBruh - I'm not sure what would cause that error 259 that your screenshot shows.  Is there any more detailed error information in the log file that might help narrow this down further?

  • Thank you for the quick reply Aaron!

    Here are the screenshots of the log file;



  • Hi SwerveBruh - The log shows that some of the commands are taking too long to run and timing out.  What I'd suggest doing is copying and pasting the command lines that timed out from the log file and running them manually to see if they will finish if you give them a longer time to run.  You can also try to re-run msiinv.exe to see if those items still appear in the list or if they actually ended up getting removed behind the scenes.

  • Hi Aaron.

    I don't understand what parts I have to copy and paste and how I can manually do it.

  • Hi SwerveBruh - The log shows errors that start with the text ****ERROR**** Timeout value exceeded for process.  You can copy and paste the command line that is listed after that text, except leave off the single quotes (') at the beginning and end of the command line.  To run the command line, you can do the following:

    1.  Open Windows Explorer and go to the folder c:\windows\system32

    2.  Right-click on the item named cmd.exe and choose Run as administrator

    3.  Copy and paste one of the command lines that failed from the log file and press enter to run it

    4.  Repeat step 3 for each of the command lines that failed from the log file

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