Uninstall Instance of SQL Server 2008 R2 Express

Got a problem you cannot solve? Try here.
Post Reply
JohnGalt
Posts: 58
Joined: Mon Sep 08, 2008 2:14 pm

Uninstall Instance of SQL Server 2008 R2 Express

Post 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?
mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: Uninstall Instance of SQL Server 2008 R2 Express

Post by mills »

Try this:

Install SQL Express (command line: /qn REMOVE=SQL_Engine INSTANCENAME="$INSTANCE_NAME$", get result into variable SQL2005)
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.
JohnGalt
Posts: 58
Joined: Mon Sep 08, 2008 2:14 pm

Re: Uninstall Instance of SQL Server 2008 R2 Express

Post by JohnGalt »

Where would I put this? (and what is the path for the uninstall for it?)
JohnGalt
Posts: 58
Joined: Mon Sep 08, 2008 2:14 pm

Re: Uninstall Instance of SQL Server 2008 R2 Express

Post 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.?
mills
Posts: 814
Joined: Tue Jul 06, 2010 7:10 pm
Location: Honolulu, HI

Re: Uninstall Instance of SQL Server 2008 R2 Express

Post 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.
Andy Mills
InstallAware
Other Help:
White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Product Guides - http://www.installaware.com/publication ... guides.htm
InstallAware Help - Press F1 in the InstallAware IDE.
Post Reply