Existing SQL Server Installation

This page as PDF

[Purpose : to determine if there is a SQL Server installation on this machine and to aid in the removal if one is found]

back

Is sqlserver on this machine?   The first and most important pre-installation question that must be answered.

The quickest likely way is to do an explorer search for *.mdf. Any files returned may indicate an installation instance. You may also find that the path C:\Program Files\Microsoft SQL Server\<some number> exists. This would mean some version had probably been installed at some point. Alas, it’s not foolproof either.

The first objective of installing SqlServer 2008 is to insure it will succeed as a 2008 server instance unaffected by prior versions. This install can be accomplished on a machine with prior versions installed, but the installation is fraught with serious potential problems which cannot be foreseen. For this reason, we recommend full removal of any prior versions, before MS SqlServer Express 2008 is installed as an ILookIX pre-requisite.

Once the 2008 SqlServer Express version is installed, the complete version (SQL Server 2008 – NON Express) from the Perlustro DVD, either 32 or 64 bit, can be installed without removal of the express version. NOTE HOWEVER, it will NOT install over ANY version of SQL Server 2005 or prior versions,  if SQL Server 2008 Express has been installed first. In that case, SQL Server Express 2008 must be removed first, then all SQL Server 2005 pieces MUST be uninstalled regardless of any other issues at that point.

You may have SQL Server installed (some version of it) and not know it. Looking for the name in Control Panel programs is the easiest way for a first glance look, but it is also possible it is not named SQL anything, but is hidden in another applications installer. This is quite common when developers use the free SQL Server Express version to power applications. Some clear cases exist where it will be installed, and virtually hidden otherwise, in particular if the following software has ever been on the installed machine:

  1. Microsoft Visual Studio, any version
  2. Microsoft Outlook Business contact manager for Outlook email clients

We assume here that a  version of SQL Server is installed (other than SQL Server 2008 Express) and you are a full ADMIN user on the machine. If SQL Server 2008 Express is installed, you should only have to change the SQL Server instance setting in ILookIX to use it. You do not want to load SQL Server 2008 twice however, so if you have installed the Express version manually or from Microsoft, there is no reason to remove it, unless it is failing to start. If SQL Server 2008 Express is installed and working, the installation of the full complete version will overload on top of the express version. Make certain however, you do NOT name a SQL Server Express version with an instance name of ILOOKIX08.

This removal process will apply to any version of SQL Server 2008, 2005 or any express install.

Unfortunately, such an inquiry, as to what is installed, and by version, is not easy to declare a yes or no. This is due to the fact SQL Server incorporates services as well as processes which are somewhat scattered around a machine landscape and in memory.

To manually uninstall an existing version for any 32 or 64 bit operating system:

Step 1.

Check Add/Remove programs for anything SQL Server by name, or closely related. If found – as in the following picture – stop the corresponding services of the same components (Step 2), then uninstall the package (Step 4). In Vista, process manager shows the running services and allows STOPPING them in that console. In XP or SVR 2003, you must go to SERVICES in Admin tools or other methods you might prefer to stop the running services.

Step 2.

In services, if you have an active SQL Server “instancename” running, it will be listed in most cases. It also may NOT be listed, if it has been previously or partially installed, or removed in a failed removal . The services screen of Vista will look similar to XP, just sort the names in order and look for the “SQL”

instancename

Step 3.

The services listed above will either indicate a valid installation or in some cases, a failed one. The difference being that if it is an active install, these services should come off and be removed during an Add/Remove function from Control Panel Programs (Step 4). Always presume this will work and always use this as the first method of removal. DO NOT remove program files folders of the installed base application until that point is reached in the instructions noted herein. If the removal gets out of sync with the registry key removals, it may be literally impossible to rectify the problems.

However, in a normal situation, you should first STOP the services listed above. Any SQL services that may be installed across all versions of SQL Server, must be removed using this method of STOPPING the service first. Just double click the service name, and select STOP (or right-click followed by Stop). Wait for it to then return “stopped”.

notice_install_path

Step 4.

In control panel, select each application listed, then do an UNINSTALL of each SQL Server listed. There is no particular order, but VSS Writer and Native Client, should be removed before SQL Server itself.

un_install

Step 5.

Assuming all this works as expected, REBOOT ! The next step is simply to go back to SERVICES and see if indeed it did work and we are FINISHED with this document. Congratulations. If you see ANY SQL Server services listed, then something in the uninstall process failed. The work to find the problem does not justify – bypassing – these succeeding steps……so we will continue……

Step 6.

Stop ALL of the services you see listed relating to SQL anything, with –Right click – STOP

Step 7.

Double click each stopped service and make a note of the “Service Name:   MSSQLnnnn”

Step 8.

From a command prompt running as administrator, run the MS utility Sc.exe, with this command line for each of the services listed :

C:\sc delete <servicename:nnn>

Example: sc delete MSSQLSERVER

If you are in VISTA, you must cut off the UAC in control panel before proceeding with the sc removal, this will require a reboot just for that change.

Continue to do “sc delete”, for each of the service names you stopped in Step 6.

An example of the deletion of the services and the result that will be returned from the command:

C:\Windows\system32>sc delete MSSQL$SQLEXPRESS
[SC] DeleteService SUCCESS
C:\Windows\system32>sc delete MSSQLServerADHelper
[SC] DeleteService SUCCESS

Note: Registry Permission blocking may occur in the following changes, so reset them for your own user level permissions if you get permission errors when removing the keys.

Edit the permission of the parent key :

(HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\<user SID>\Components)

Click the Advanced button and reset the permissions on the key.

If SC.EXE fails to uninstall the services, and there are no other instances of SQL Server installed, delete the registry keys :

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSSQLServer,
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSQLSERVER
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\SQLAgent

Next, Search for <Instance Name> in this registry key. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall. If you find any, usually with a value called “InstanceId”, run the following  command at a terminal window:

MSIEXEC /X <GUID>

where the <GUID> is the key name containing the InstanceId value. This will remove the installer information already on the machine

Step 9.

From the Perlustro DVD tools folder or downloaded from Microsoft, run the utility cleanup as described at http://support.microsoft.com/kb/290301. Select one or more programs that were installed by Windows Installer from the Windows Installer CleanUp dialog box that will appear. Find any SQL Server installations and select to uninstall them. This removes the installer information for the instancename of SQL Server itself.

Step 10.

At this point, please make a System Restore point, or system backup before proceeding.

Using REGEDIT go to the following key and right click all Microsoft SQL folders and select DELETE:

HKEY_LOCAL_MACHINE/ SOFTWARE/MICROSOFT

Step 11.

Using Windows Explorer, go to “Program Files” or the x86 version, right click all Microsoft SQL folders and select DELETE

Step 12.

You now have to access the Application Data folder for your username.

Vista:
* this is done by typing in the explorer bar C:\users\userName\AppData\Microsoft\

XP:
* You should find a sql server folder in the following location – Delete it.
If you are dealing with express versions, the location of express to be deleted may be in this path:
%USERPROFILE%\Local Settings\Application Data\Microsoft\Microsoft SQL Server Data\SQLEXPRESS”

Step 13.

Delete all files in %Program Files%\Microsoft SQL Server

Step 14.

Open REGEDIT32 and delete key “HKCU\Software\Microsoft\Microsoft SQL Server” (HKEY_CURRENT_USER)

Step 15.

Open REGEDIT32 and delete key “HKLM\Software\Microsoft\Microsoft SQL Server” (HKEY_LOCAL_MACHINE)

You may find that the keys are located on the registry key name : HKLM\SOFTWARE\Microsoft\MSSQLServer (you may already have deleted this key earlier)

Step 16.

Reboot one last time and a returning system should have no running SQL Server instances . If there are SQL Server instances visible, then the permissions of the logged on user is likely to be the problem. Other problems can include a failure to stop services before deletion or a failure to remove Registry entries relating to SQL Server.

If a new instance of SQL Server cannot be installed, you may have to repeat this above process and use the following Microsoft guide in addition to the above steps: http://support.microsoft.com/default.aspx/kb/909967/en-us. Take particular note of the section relating to removal of the setup uninstallers. While this article applies to SQL Server 2005, it is also appropriate for prior versions.

The primary difference in the methods used, relates to the guid removal as follows;

Start Registry Editor, and then locate the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

1. In the left pane, click each GUID. For each GUID that you click, look for a display name in the right pane that includes “Microsoft SQL Server 2005.” For example, look for the following names:

Microsoft SQL Server 2005

Microsoft SQL Server 2005 Analysis Services, Microsoft SQL Server 2005 Reporting Services,Microsoft SQL Server 2005 Notification Services, Microsoft SQL Server 2005 Integration Services,Microsoft SQL Server 2005 Tools Microsoft SQL Server 2005 Books Online

2. When you see a display name that includes “Microsoft SQL Server 2005,” note the GUID that you clicked in the left pane.

For each GUID that you noted in step 2, run the following command at a command prompt:

start /wait msiexec /x {GUID} /l*v c:\sql_uninstall.log

Notes:

In this command, replace GUID with the GUID that you noted in step 2.

Every SQL Server installation will create LOG files. They are located variously on the Program Files path of the SQL Server installer as noted above. Feel free to gather these reports and logs and furnish them to installlogs@perlustro.com to help identify the issues that may remain.

At the conclusion of any installation successful or failed, find the setup installer log file named “summary*.txt” in the bootstrap folder on the path C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log

Lastly, if you are not running VISTA, you can find further solutions to the removal process of SQL Server by an indepth study of the machine using Microsoft’s reporting tools, downloaded from http://support.microsoft.com/kb/900699. An X64 version is located at http://www.microsoft.com/downloads/details.aspx?FamilyId=00AD0EAC-720F-4441-9EF6-EA9F657B5C2F&displaylang=en. A Microsoft KB article http://support.microsoft.com/kb/909967 also approaches the manual uninstalls of SQL Server using some different methods.

back

Normal0falsefalsefalseMicrosoftInternetExplorer4< ![endif] >< ! [if gte mso 9]>< ![endif] >< ! /* Font Definitions */ @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1610611985 1073750139 0 0 159 0;} @font-face {font-family:Verdana; panose-1:2 11 6 4 3 5 4 4 2 4; mso-font-charset:0; mso-generic-font-family:swiss; mso-font-pitch:variable; mso-font-signature:-1593833729 1073750107 16 0 415 0;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:”"; margin-top:0in; margin-right:0in; margin-bottom:10.0pt; margin-left:0in; line-height:115%; mso-pagination:widow-orphan; font-size:11.0pt; font-family:Calibri; mso-fareast-font-family:Calibri; mso-bidi-font-family:”Times New Roman”;} a:link, span.MsoHyperlink {font-family:”Times New Roman”; mso-bidi-font-family:”Times New Roman”; color:blue; text-decoration:underline; text-underline:single;} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline; text-underline:single;} @page Section1 {size:8.5in 11.0in; margin:1.0in 1.25in 1.0in 1.25in; mso-header-margin:.5in; mso-footer-margin:.5in; mso-paper-source:0;} div.Section1 {page:Section1;} /* List Definitions */ @list l0 {mso-list-id:1217546568; mso-list-template-ids:517659000;} @list l0:level1 {mso-level-tab-stop:.5in; mso-level-number-position:left; text-indent:-.25in; mso-bidi-font-family:”Times New Roman”;} @list l0:level2 {mso-level-number-format:bullet; mso-level-text:o; mso-level-tab-stop:1.0in; mso-level-number-position:left; text-indent:-.25in; mso-ansi-font-size:10.0pt; font-family:”Courier New”; mso-bidi-font-family:”Times New Roman”;} @list l0:level3 {mso-level-tab-stop:1.5in; mso-level-number-position:left; text-indent:-.25in; mso-bidi-font-family:”Times New Roman”;} @list l0:level4 {mso-level-tab-stop:2.0in; mso-level-number-position:left; text-indent:-.25in; mso-bidi-font-family:”Times New Roman”;} @list l0:level5 {mso-level-tab-stop:2.5in; mso-level-number-position:left; text-indent:-.25in; mso-bidi-font-family:”Times New Roman”;} @list l0:level6 {mso-level-tab-stop:3.0in; mso-level-number-position:left; text-indent:-.25in; mso-bidi-font-family:”Times New Roman”;} @list l0:level7 {mso-level-tab-stop:3.5in; mso-level-number-position:left; text-indent:-.25in; mso-bidi-font-family:”Times New Roman”;} @list l0:level8 {mso-level-tab-stop:4.0in; mso-level-number-position:left; text-indent:-.25in; mso-bidi-font-family:”Times New Roman”;} @list l0:level9 {mso-level-tab-stop:4.5in; mso-level-number-position:left; text-indent:-.25in; mso-bidi-font-family:”Times New Roman”;} ol {margin-bottom:0in;} ul {margin-bottom:0in;} >< ! [if gte mso 10]>< ! /* Style Definitions */ table.MsoNormalTable {mso-style-name:”Table Normal”; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:”"; mso-padding-alt:0in 5.4pt 0in 5.4pt; mso-para-margin:0in; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:”Times New Roman”; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} > < ! [endif] >

If a new instance of SqlServer cannot be installed, you may have to repeat this above process and use, in addition, http://support.microsoft.com/default.aspx/kb/909967/en-us as a guide for removal, in particular the section relating to removal of the setup uninstallers.  While this article applies to 05 server, it is also appropriate for prior versions.

The primary difference in the methods used, relates to the guid removal as follows ;

Start Registry Editor, and then locate the following registry key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

< ! [if !supportLists] >1.< ! [endif] >In the left pane, click each GUID. For each GUID that you click, look for a display name in the right pane that includes “Microsoft SQL Server 2005.” For example, look for the following names:

< ! [if !supportLists] >o< ! [endif] >Microsoft SQL Server 2005

< ! [if !supportLists] >o< ! [endif] >Microsoft SQL Server 2005 Analysis Services, Microsoft SQL Server 2005 Reporting Services,Microsoft SQL Server 2005 Notification Services , Microsoft SQL Server 2005 Integration Services,Microsoft SQL Server 2005 Tools Microsoft SQL Server 2005 Books Online
When you see a display name that includes “Microsoft SQL Server 2005,” note the GUID that you clicked in the left pane.
For each GUID that you noted in step 2, run the following command at a command prompt:
start /wait msiexec /x {
GUID} /l*v c:\sql_uninstall.log
Notes

In this command, replace
GUID with the GUID that you noted in step 2.

Every sqlserver installation will create LOG files.   They are located variously on the Program Files path of the SQL installer as noted above.   Feel free to gather these reports and logs and furnish them to installlogs@perlustro.com to help identify the issues that may remain.

At the conclusion of any installation successful or failed, find the setup installer log file named “summary*.txt” in the bootstrap folder on the path C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log

Lastly, if you are not running VISTA, you can further find solutions to the removal process of SqlServer by an indepth study of the machine using Microsoft’s reporting tools, downloaded from http://support.microsoft.com/kb/900699  an x64 version is http://www.microsoft.com/downloads/details.aspx?FamilyId=00AD0EAC-720F-4441-9EF6-EA9F657B5C2F&displaylang=en .   A KB article http://support.microsoft.com/kb/909967 also approaches the manual uninstalls using some different methods.