Page 1 of 1

Uninstall Instance of SQL Server 2008 R2 Express

Posted: Wed Jul 14, 2010 9:34 am
by JohnGalt
How can I get the uninstall process to uninstall SQL Server 2008 R2 Express (named instance that will never be used by anyone else) on uninstall automatically?

Re: Uninstall Instance of SQL Server 2008 R2 Express

Posted: Thu Jul 15, 2010 5:29 pm
by mills
Try this:

Install SQL Express (command line: /qn REMOVE=SQL_Engine INSTANCENAME="$INSTANCE_NAME$", get result into variable SQL2005)

Re: Uninstall Instance of SQL Server 2008 R2 Express

Posted: Fri Jul 16, 2010 12:44 pm
by JohnGalt
Where would I put this? (and what is the path for the uninstall for it?)

Re: Uninstall Instance of SQL Server 2008 R2 Express

Posted: Fri Sep 17, 2010 2:26 pm
by JohnGalt
*ping*

How would I add this to the uninstall process safely ensuring that I get the right directory to run the uninstall etc.?

Re: Uninstall Instance of SQL Server 2008 R2 Express

Posted: Fri Sep 17, 2010 8:00 pm
by mills
I apologize, as I'm confident my previous example won't work. That's only good for installing.

The first objective would be to figure out how to uninstall SQL Server without using IA (and with the command line)...

This article might help:
http://support.microsoft.com/kb/955499

You're likely going to need to consult Microsoft on this.

But, once you have that figured out, you should be able to place the code to do it either immediately before or after your Apply Uninstall command, since it shouldn't matter whether your program is installed or not.

I would re-use the checksql... script to be sure that it is currently installed and then "if Variable SQL2008R2_X86 not Equals FALSE", then do the uninstall.