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.

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>

 

Comments (72)

  1. Kylir Horton says:

    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?

  2. 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 Server90Setup BootstrapLogFiles*.*

    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.

  3. Coen Roos says:

    Thx did the trick for me!

  4. Help Desk says:

    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.

  5. Colin Sanson says:

    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 SettingsUsernameTemp. This meant that SQL Server components where still on my system, however it no longer appeared in the Add/Remove programs list

  6. Alex says:

    Thanks!

    I was beating my head against a wall untill I found this blog!

  7. Carriat says:

    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..:)

  8. Lisa Shanley says:

    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

  9. todd says:

    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!

  10. Hi Lisa – can you please zip and send me the log files located at %ProgramFiles%Microsoft SQL Server90Setup BootstrapLogFiles 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)

  11. Todd says:

    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

  12. 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 Server90Setup BootstrapLogFiles) 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.

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

  14. Gabhan says:

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

    Cheers,

    Gabhan

  15. lance says:

    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?

  16. 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!

  17. David says:

    thanks a lot !

  18. Satya says:

    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?

  19. Hi Satya – SQL Express setup creates log files at %ProgramFiles%Microsoft SQL Server90Setup BootstrapLogFiles 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.

  20. Jorge says:

    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?

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

  22. derek says:

    http://blogs.msdn.com/astebner/archive/2005/10/30/487096.aspx is dead, Server Error in ‘/’ Application.  Nice.

  23. 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?

  24. Jay Connaughton says:

    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?

  25. 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).

  26. spencer says:

    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!

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

  28. Jacob Pettersson says:

    This guide helped me greatly!!!!!!

    Was seconds from formatting (or throwing the computer out the window)

  29. David M. Bennett says:

    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?

  30. 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…

  31. David M. Bennett says:

    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.

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

  33. Walimay says:

    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.

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

  35. Wiles says:

    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!

  36. dananos says:

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

    Any ideas?

  37. 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…

  38. johnmabbott says:

    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

  39. sriki38 says:

    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

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

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

  42. pardhac says:

    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

  43. bobv says:

    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.

    b6789b

  44. 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_MACHINESoftwareMicrosoftWindowsCurrentVersionUninstall in your registry.

    -or-

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

  45. menz says:

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

  46. Andrei says:

    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.

  47. John says:

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

  48. Victor says:

    Thx! It Solved the priblem, awesome fix !

  49. harddragon@hotmail.co.uk says:

    Unfortunately, I have encountered a problem.

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

    Putting in the command;

    http://prntscr.com/58g8ud

    Error;

    http://prntscr.com/58g8z8

  50. 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?

  51. harddragon@hotmail.co.uk says:

    Thank you for the quick reply Aaron!

    Here are the screenshots of the log file;

    http://prntscr.com/58j88e

    http://prntscr.com/58j8a6

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

  53. harddragon@hotmail.co.uk says:

    Hi Aaron.

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

  54. 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:windowssystem32

    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

  55. harddragon@hotmail.co.uk says:

    I followed your instructions but I seem to be getting the same error again unfortunately.

    Here is what I did;

    http://prntscr.com/58yru7

    Here is the error;

    http://prntscr.com/58ysay

  56. Hi SwerveBruh – You're not copying and pasting the same command lines that I was thinking of.  From http://prntscr.com/58j8a6, the commands that I am referring to are the ones that start with c:smartmsizapmsizapw.exe TP.

  57. harddragon@hotmail.co.uk says:

    These are the ones I copied and pasted onto CMD;

    http://prntscr.com/58z5rp

  58. Hi SwerveBruh – Sorry, but that isn't what your screenshots showed in your previous reply. Can you please double-check?

  59. harddragon@hotmail.co.uk says:

    Oh, I'm sorry, my mistake. I kept getting errors so I got confused.

    Here is the one that I told you about earlier;

    http://prntscr.com/58zvbn

    Here is the line; [11/21/14,07:39:55] Launching process 'C:smartmsizapmsizapw.exe TP {F31183CF-E10F-4DE1-BB59-6C0FF38E481E}' now

    What I copied and pasted into the CMD is {F31183CF-E10F-4DE1-BB59-6C0FF38E481E} yet I get the same error.

  60. Hi SwerveBruh – That is only a part of the command line. In your example above, you would need to run the following:

    C:smartmsizapmsizapw.exe TP {F31183CF-E10F-4DE1-BB59-6C0FF38E481E}

  61. Treetowncamel says:

    Hello Aaron, this is an excellent guide!

    But unfortunately the trick didn't click for me. The trick worked once, but I messed up so I decided to try it again. I ran smartmsizap.exe for every product on the mssinv output list but nope, doesn't work. I even deleted visual studio, I guess that was optional but, meh. I deleted everything to do with SQL Server. (Common files, files in regedt32, services, etc.) When I did do the following, I didn't restart my computer if that's the case – nonetheless, the way I tried it, it didn't work. A quick response would be awesome!

    -Treetowncamel

  62. Hi Treetowncamel – I'm sorry for the hassles that you're running into while trying these steps.  When you say that it didn't work, what does that mean exactly?  Does smartmsizap give an error, or does it give you an error when you try to re-install SQL Server afterwards?

    If anyone reading this blog post continues to have trouble with SQL Server setup after trying the steps listed here, I'd suggest searching for additional suggestions or posting a new question on the SQL Server setup forum at social.msdn.microsoft.com/…/home.

  63. Kathy Ano says:

    Hello Sir,

    I uninstalled Sql server 2008 in wrong order before uninstalling the main uninstaller. And now it shows that the uninstallation is properly done. But the file is still created in the C drive with 700 mb. And I can't even uninstall it using command prompt because the Setup Bootstrap doesn't contains any setup.exe file .

  64. Hi Kathy Ano – It might help to use the manual uninstall steps at blogs.msdn.com/…/487096.aspx.  If those steps don't work, then I'd suggest posting a question on the SQL Server setup forum at social.msdn.microsoft.com/…/home to see if someone there has any other ideas for you to try out.

  65. Farid says:

    This saved my life!! Thanks alot for clear and effective instructions

  66. Lord Serch says:

    Thank you so much!!!! this worked like a charm on Windows 7

Skip to main content