Share via


How to clean up a SQL 2005 instance name left behind by a previous uninstall

I have heard from a few customers who have tried to uninstall and re-install SQL 2005 and have run into errors with both the uninstall and the re-install. I have already described the most common uninstall error and a suggested workaround in this previous blog post (an error reading property "Installids" from the cache and/or an error writing property "flagCommit" to the cache).

I wanted to address one of the most common SQL Express install errors I have seen - a duplicate instance name error that causes SQL setup to fail and rollback. It is pretty easy to tell if you are running into this error if you launch SQL setup directly and step through the SQL setup UI. However, if you are installing SQL Express as a part of Visual Studio 2005, setup runs in silent mode and you will only see a generic error bubbled up from Visual Studio setup indicating that SQL Express failed to install.

VS 2005 configures SQL Express with an instance name of SQLEXPRESS when it runs SQL setup in silent mode. If you previously had SQL Express installed and try to uninstall it but something goes wrong with uninstall, you may end up with an orphaned instance name on your system, and then re-installing SQL Express can fail. In this case, the verbose setup log file for SQL Express will show an error that looks like the following:

MSI (s) (AC!38) [00:01:41:056]: Product: Microsoft SQL Server 2005 Express Edition -- 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.

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.

If you are running into an error installing SQL Express as a part of Visual Studio 2005 setup, you can check in the SQL Express log files (located at %ProgramFiles%\Microsoft SQL Server\90\Setup Bootstrap\LOG). If you are receiving an error about the instance name not being unique, you can manually clean off the orphaned instance name by doing the following:

  1. Click on the Start menu, choose Run and type regedit
  2. Go to HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server
  3. Remove SQLEXPRESS from the REG_MULTI_SZ value named InstalledInstances
  4. Delete the subhive named MSSQL.1
  5. Delete the subhive named SQLEXPRESS
  6. Go to HKEY_LOCAL_MACHINE\Software\Microsoft\Microsoft SQL Server\Instance Names\SQL
  7. Delete the value named SQLEXPRESS
  8. Delete the folder %ProgramFiles%\Microsoft SQL Server\MSSQL.1

Note - the above steps apply to the instance name that is created when SQL Express is installed as a part of Visual Studio 2005. The actual instance name on your system may vary if you have had any other beta version of SQL 2005 (such as the developer edition). Please make sure to adjust the steps accordingly based on what instance name information is in your registry and file system.

<update date="7/24/2009"> Updated this post to not be beta-specific. The same type of error can occur if you uninstall and re-install the final release of SQL Express or SQL Express service packs. </update>

Comments

  • Anonymous
    December 22, 2005
    i have installed the german sql 2000
    sql 2005 named instance (us) and sql express us
    Now i unistalled sql2005 completley to install sql epxress german edition
    i get the above error
    i cleaned the registry and the mssql.1 directory

    any idea?

  • Anonymous
    January 04, 2006
    My initial install had gone well with the final vs express release... but later something messed up my installation and i tried to uninstall and reinstall about ten times vs c++ express and sql express server... in different combinations as a whole or only sql server... i tried to follow the instructions on your blog... all went futile.... giving up for now... and hoping that you are planning to address this sql install-uninstall problem in near future ...

    PS. what the heavens is remained behind when i uninstall it??? it is not beta... or is it? under the disguise of final release...

  • Anonymous
    January 09, 2006
    Hi Alp - I'm sorry that you've run into this issue. Just to confirm, you have been trying to reinstall the final release of SQL 2005 Express and it is failing? If that is correct, can you please zip and send the log files located at %ProgramFiles%Microsoft SQL Server90Setup BootstrapLogFiles to aaronste@microsoft.com so I can try to take a look?

  • Anonymous
    February 07, 2006
    Thanks,

    Martin Kulov

  • Anonymous
    March 31, 2006
    I need to provide a silent Installation of SQL Express 2005, wherein the user doesn't have to click on the next button as in that of a normal installation by giving the required info and iam using Install Sheild 11.5. Can anyone suggest an idea like how to do a Silent Installation.

  • Anonymous
    May 10, 2006
    while I found that Add /remove control panel,there are no list of sql ,but
    start edit we can see that there are
    left item. why ?

  • Anonymous
    May 11, 2006
    The comment has been removed

  • Anonymous
    September 14, 2006
    PingBack from http://hkmicc.wordpress.com/2006/09/15/clean-up-a-sql-2005-instance-name/

  • Anonymous
    February 16, 2007
    Where to get Visual Studio 2005 and the .NET Framework 2.0 Where to download the .NET Framework 2.0 redistributable

  • Anonymous
    December 25, 2008
    It worked for me, but i was a little desperate and erased de whole sql server key on Local machine. It solved a Business Contact Manager Installation too!

  • Anonymous
    September 10, 2010
    Thanks, have spent many hours trying to figure this out

  • Anonymous
    September 20, 2010
    worked great! thanks

  • Anonymous
    September 23, 2010
    I have the same problem but with SQL 2008. I installed it last year and then uninstalled it the same year. This year im trying to install it again and it says i already have an instance in use.

  • Anonymous
    September 23, 2010
    Hi Duarte - I don't have any specific experience working with SQL Server 2008 issues like this, but I think that steps similar to the ones in this blog post will work for SQL Server 2008 as well.  If you don't have any luck with that, then I'd suggest posting a question on the SQL Server setup forum at social.msdn.microsoft.com/.../threads to see if someone there can provide some additional suggestions for you to try.

  • Anonymous
    February 02, 2011
    Thanks! Fixed having an old Sophos AV sql instance left in registry!

  • Anonymous
    June 30, 2011
    I wanted to thank you for this information. It was helpful to me and allowed me to move on with my project. Thanks Larry A

  • Anonymous
    August 01, 2011
    Thank you for giving such awonderful help!!will try this

  • Anonymous
    September 21, 2011
    Thank you

  • Anonymous
    November 21, 2011
    Hi First of all thanks for sharing this information it indeed worked superbly... Now when i start my management studio( SQL SERVER 2005 developers edition) I dont get my Service name for Database Engine ...Please can you help me out from where can i get this instance name... thanks..

  • Anonymous
    November 21, 2011
    Hi Idris Nagri - This type of question is outside of my areas of expertise.  I'd suggest posting a question on one of the SQL Server forums at social.msdn.microsoft.com/.../sqlserver.

  • Anonymous
    April 30, 2012
    There are different registry keys to delete for Win7 64bit operating system. I searched for MSSQLServer in the registry and found the references to mssql.1 and mymovies instance.

  • Anonymous
    May 01, 2012
    Hi Alistair Ramsay - Thank you for pointing this out.  On 64-bit versions of Windows, the registry keys will be located at HKEY_LOCAL_MACHINESoftwareWow6432NodeMicrosoftMicrosoft SQL Server.

  • Anonymous
    September 07, 2012
    Bro Please Help Me To Remove A Server Name in my SQL 2005 Please ? sorry for my wrong grammar :))

  • Anonymous
    September 07, 2012
    Hi AsMoth - I'd suggest posting a question in the SQL Server setup forum for this issue.  You can find that forum at social.msdn.microsoft.com/.../threads.

  • Anonymous
    July 22, 2013
    Thanks Alistair Ramsay: found it under KEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftMicrosoft SQL ServerInstance NamesSQL; removed (my two) listed on right and install then didn't ask to use a different instance name (as I wanted to use the default, but uninstall didn't quite remove).

  • Anonymous
    July 22, 2013
    Also had to remove two keys "MSSQL.1" and "MSSQL.2" under KEY_LOCAL_MACHINESOFTWAREWow6432NodeMicrosoftMicrosoft SQL Server

  • Anonymous
    August 21, 2013
    Worked...Thank you !!!

  • Anonymous
    October 20, 2013
    thnx

  • Anonymous
    February 13, 2014
    easy to delete thanx

  • Anonymous
    November 18, 2014
    thanxxx......sooo much

  • Anonymous
    January 30, 2015
    I have spent 2 weeks to delete the instance. Finally I saw this thread. It works perfectly. Thank you so much.

  • Anonymous
    March 31, 2015
    Thank u so Much.......

  • Anonymous
    April 23, 2015
    Wow, almost 10 years later and the advice is still solid. I had uninstalled SQL Express but those few items were still hiding in the registry preventing a new install. Huge thanks!

  • Anonymous
    May 06, 2015
    thank u ......

  • Anonymous
    January 18, 2016
    thank u so much