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:
- Download and run msiinv.exe using the instructions in this previous blog post
- 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
- Click on the Start menu, choose Run and type cmd
- 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
- Download the smartmsizap tool
- 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
Anonymous
October 06, 2005
The comment has been removedAnonymous
October 10, 2005
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.Anonymous
October 31, 2005
Thx did the trick for me!Anonymous
November 09, 2005
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.Anonymous
November 10, 2005
The comment has been removedAnonymous
November 20, 2005
The comment has been removedAnonymous
November 27, 2005
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
http://download.microsoft.com/download/e/9/d/e9d80355-7ab4-45b8-80e8-983a48d5e1bd/msicuu2.exeAnonymous
December 10, 2005
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..:)Anonymous
December 26, 2005
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.
LisaAnonymous
December 26, 2005
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!Anonymous
December 26, 2005
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)Anonymous
December 27, 2005
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. --ToddAnonymous
December 27, 2005
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.Anonymous
December 27, 2005
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.Anonymous
December 28, 2005
Thanks for the tips. Got my SQL Betas removed and SQLExpress installed and running nicely..
Cheers,
GabhanAnonymous
January 07, 2006
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?Anonymous
January 08, 2006
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!Anonymous
January 13, 2006
thanks a lot !Anonymous
February 19, 2006
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?Anonymous
February 19, 2006
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.Anonymous
February 20, 2006
The comment has been removedAnonymous
February 20, 2006
The comment has been removedAnonymous
March 22, 2006
http://blogs.msdn.com/astebner/archive/2005/10/30/487096.aspx is dead, Server Error in '/' Application. Nice.Anonymous
March 22, 2006
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?Anonymous
March 23, 2006
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?Anonymous
March 23, 2006
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).Anonymous
April 20, 2006
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!Anonymous
April 20, 2006
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.Anonymous
April 25, 2006
This guide helped me greatly!!!!!!
Was seconds from formatting (or throwing the computer out the window)Anonymous
May 16, 2006
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?Anonymous
May 17, 2006
The comment has been removedAnonymous
May 17, 2006
The comment has been removedAnonymous
May 17, 2006
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.Anonymous
May 25, 2006
The comment has been removedAnonymous
May 28, 2006
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.Anonymous
June 13, 2006
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!Anonymous
June 23, 2006
PingBack from http://blogs.msdn.com/astebner/articles/492809.aspxAnonymous
July 25, 2006
When I try to uninstall SQL express, it comes up with ".NET framework 2.0" is not installed - but it is?
Any ideas?Anonymous
July 30, 2006
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...Anonymous
August 23, 2006
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 thanksAnonymous
September 14, 2006
PingBack from http://hkmicc.wordpress.com/2006/09/15/clean-up-a-sql-2005-instance-name/Anonymous
November 21, 2006
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! -SrikanthAnonymous
February 16, 2007
Where to get Visual Studio 2005 and the .NET Framework 2.0 Where to download the .NET Framework 2.0 redistributableAnonymous
July 09, 2007
I recently instaled an appliaction (Laptop version of CRM Client which installed an instance of MS SQLAnonymous
November 13, 2007
PingBack from http://thebackroomtech.wordpress.com/2007/11/13/sonicwall-viewpoint-41-installation-error-sql-server-does-not-exist-or-access-denied/Anonymous
February 11, 2008
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
January 20, 2009
PingBack from http://www.hilpers.com/1030546-vs-2005-installierenAnonymous
February 15, 2009
PingBack from http://www.bsmsoft.com/911Error/?p=1Anonymous
June 29, 2009
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. b6789bAnonymous
June 29, 2009
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:
- 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-
- Re-install SQL Server, and then use the normal uninstall process to remove it.
Anonymous
April 13, 2011
Thanks a ton... This post has helped me immensely... Keep up the good work... Thanks once again...Anonymous
October 22, 2011
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.Anonymous
August 07, 2012
Thanks man! Awesome fix. The registry key delete that so many others promote did not work for me! Your fix did! Kudos!Anonymous
September 27, 2012
Thx! It Solved the priblem, awesome fix !Anonymous
November 20, 2014
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/58g8z8Anonymous
November 20, 2014
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?Anonymous
November 20, 2014
Thank you for the quick reply Aaron! Here are the screenshots of the log file; http://prntscr.com/58j88e http://prntscr.com/58j8a6Anonymous
November 21, 2014
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.Anonymous
November 21, 2014
Hi Aaron. I don't understand what parts I have to copy and paste and how I can manually do it.Anonymous
November 21, 2014
The comment has been removedAnonymous
November 21, 2014
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/58ysayAnonymous
November 22, 2014
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.Anonymous
November 22, 2014
These are the ones I copied and pasted onto CMD; http://prntscr.com/58z5rpAnonymous
November 22, 2014
Hi SwerveBruh - Sorry, but that isn't what your screenshots showed in your previous reply. Can you please double-check?Anonymous
November 22, 2014
The comment has been removedAnonymous
November 22, 2014
The comment has been removedAnonymous
November 26, 2014
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! -TreetowncamelAnonymous
November 29, 2014
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.Anonymous
May 21, 2015
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 .Anonymous
May 22, 2015
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.Anonymous
November 06, 2015
This saved my life!! Thanks alot for clear and effective instructionsAnonymous
February 01, 2016
Thank you so much!!!! this worked like a charm on Windows 7Anonymous
May 01, 2017
The comment has been removed