setup.exe /qb REMOVE=ALL instancename=test

Hello ,

I am usingMSFT SQL Server 2005(v 9.00) and have 3 databases listed under Database when I launch SQL Mgmt Studio

These are:

Deva, Devb, Test

I have to UNINSTALL and REMOVE only the TEST instance. I did following:

setup.exe /qb REMOVE=ALL instancename=test

I launch the above from C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap>

but it does NOT UNINSTALL that TEST instance... can anyone please help me on this?

Whats the BEST WAY to remove a DB Instance via COMMAND LINE....

NOTE: I have to use COMMAND LINE only to uninstall... please help

THANKS!

Mr. Bombay

[771 byte] By [BOMBAY_108] at [2007-12-21]
# 1

when I execute above command...it launches SQL Server window saying "MSFT SQL SERVER 2005 Setup"

and then throws following:

TITLE: Microsoft SQL Server 2005 Setup

You must use the control panel to modify an existing SQL Server 2005 installation. To proceed, go to Add or Remove Programs in Control Panel, select the SQL Server 2005 entry, and then click Change/Remove. To perform a new installation, run setup.exe from the installation media.

For help, click: http://go.microsoft.com/fwlink?LinkID=20476&ProdName=Microsoft+SQL+Server&ProdVer=9.00.1399.06&EvtSrc=setup.rll&EvtID=70382&EvtType=sqlspars%5csqlspars.cpp%40InvokeSqlSetupDllAction%40DwLaunchMsiExec%400x112ee


BUTTONS:

OK

BOMBAY_108 at 2007-9-10 > top of Msdn Tech,SQL Server,SQL Server Setup & Upgrade...
# 2

What is the path of the setup.exe that you are trying to call? If you installed this from a cd, can you insert the cd again and run from that drive? Similarly, if you installed from a network share, can you try running the setup.exe from there?

Thanks,
Sam Lester (MSFT)

SamuelLester-MSFT at 2007-9-10 > top of Msdn Tech,SQL Server,SQL Server Setup & Upgrade...
# 3

Thanks Sam...

I am running this from C:\Program Files\Microsoft SQL Server\90\Setup Bootstrap directory...

Can I use osql also instead of setup? are they same?

BOMBAY_108 at 2007-9-10 > top of Msdn Tech,SQL Server,SQL Server Setup & Upgrade...
# 4

Here is an article about running an unattended uninstall.

http://msdn2.microsoft.com/en-us/ms144259.aspx#uninstallscripts

To remove a default, stand-alone installation of SQL Server 2005 from the command prompt

  1. Insert the SQL Server 2005 installation media into the disk drive.

  2. Uninstall SQL Server, using the following syntax:

    Start /wait <CD or DVD Drive>\setup.exe /qb REMOVE=SQL_Engine,Client_Components INSTANCENAME=<InstanceName>

    For the default instance, specify "MSSQLSERVER" for <InstanceName>. Using REMOVE=ALL to remove instance components also removes shared components: SQL Server Tools, Integration Services, and Notification Services.

It also mentions to use the original media. It doesn't mention the use of a mapped network drive, but I know this works as well. So if you needed to uninstall over a few machines, you could place the media in one machine and access it from the others.

Thanks,
Sam Lester (MSFT)

SamuelLester-MSFT at 2007-9-10 > top of Msdn Tech,SQL Server,SQL Server Setup & Upgrade...
# 5

Sorry, I forgot to reply to the question about osql. The osql (and now even better, sqlcmd) utility is used to run adhoc queries from a command prompt window, or can be used to execute a script containing T-SQL statements. It's not intended to be used as an install/uninstall method.

Thanks,
Sam Lester (MSFT)

SamuelLester-MSFT at 2007-9-10 > top of Msdn Tech,SQL Server,SQL Server Setup & Upgrade...
# 6

Thank You Sir Sam.

Actually I got confused with osql. I was able to work on my stuff by using

osql -S localhost -E -q "drop database test"

Is there any link which talks about osql?

Thanks!

BOMBAY_108 at 2007-9-10 > top of Msdn Tech,SQL Server,SQL Server Setup & Upgrade...
# 7

Your best bet would be to search SQL Books Online (BOL) for sqlcmd (the new tool to replace osql). There are a lot of examples and documentation there. After digging in there, feel free to post any specific questions here as well.

Thanks,
Sam Lester (MSFT)

SamuelLester-MSFT at 2007-9-10 > top of Msdn Tech,SQL Server,SQL Server Setup & Upgrade...
# 8
THANK YOU for your time and assistance.
BOMBAY_108 at 2007-9-10 > top of Msdn Tech,SQL Server,SQL Server Setup & Upgrade...

SQL Server

Site Classified