Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

nscontrol delete Command

SQL Server 2005

Updated: 5 December 2005

Deletes an existing instance of SQL Server Notification Services.


nscontrol delete 
    [-nologo]
    [-help]
        –name instanceName
        -server databaseServer
    [-sqlusername sqlUserName -sqlpassword sqlPassword]
    [-force]
nologo

Suppresses the product and version statement that appears when you run an nscontrol command.

help

Displays the command syntax.

name instanceName

Is the name of the instance to delete.

server databaseServer

Is the name of the server that hosts the instance and application databases. If you use a named instance of SQL Server, you must specify both the server name and the instance name using the format servername\instancename.

sqlusername sqlUserName

Is the SQL Server logon ID used to connect to SQL Server.

If you are using SQL Server Authentication to connect to SQL Server, specify a login with this argument. Also specify a password using the sqlpassword argument.

If you are using Windows Authentication to connect to SQL Server, do not use the sqlusername and sqlpassword arguments.

ms162764.security(en-US,SQL.90).gifSecurity Note:
When possible, use Windows Authentication.

sqlpassword sqlPassword

Is the password associated with the sqlusername login. This argument must be used together with the sqlusername argument.

force

Attempts to force the closure of any open database connections before deleting databases, without prompting the user. Without the force argument, if a database still has open connections, the nscontrol delete command cannot delete that database. The nscontrol delete command will attempt to delete all other databases for the instance.

ms162764.note(en-US,SQL.90).gifNote:
Using nscontrol delete without the force argument when some databases have open connections can leave the instance in an inconsistent state. Before you run nscontrol delete with the force argument, make sure to stop the NS$instance_name Windows service.

The nscontrol delete command deletes the instance and application databases only if they were created by Notification Services. Use the nscontrol unregister command to remove the registry key, the performance counters, and any Windows service for the instance.

The account used to run nscontrol delete, or the SQL Server login specified by the -sqlusername argument, must have permission to drop databases. This includes membership in the dbcreator or sysadmin fixed server role. The account must also have permission to execute the Notification Services binary files; this permission is granted to members of the Administrators and SQLServerNotificationServicesUser Windows groups.

A. Basic example

The following example shows how to delete the databases for an instance of Notification Services named StockInstance, using Windows Authentication to connect to SQL Server.

nscontrol delete -name StockInstance -server nsuetest

B. Forcing open connections to be closed and then deleting an instance

The following example shows how to force the closure of all open connections to the instance and application databases, without prompting the user, before deleting the databases. The nscontrol command uses Windows Authentication to connect to SQL Server.

nscontrol delete -name StockInstance -server nsuetest -force

C. Deleting an instance using SQL Server Authentication

The following example shows how to delete the databases for an instance of Notification Services named StockInstance, using SQL Server Authentication to connect to SQL Server.

nscontrol delete -name StockInstance -server nsuetest 
    -sqlusername SqlUser -sqlpassword sQl-P@sWd

Release History

5 December 2005

New content:
  • Added information about the SQLServerNotificationServicesUser Windows group.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.