Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
KILL QUERY NOTIFICATION SUBSCRIPTION (Transact-SQL)
Collapse the table of content
Expand the table of content

KILL QUERY NOTIFICATION SUBSCRIPTION (Transact-SQL)

Removes query notification subscriptions from the instance. This statement can remove a specific subscription or all subscriptions.


KILL QUERY NOTIFICATION SUBSCRIPTION 
   { ALL | subscription_id }

ALL

Removes all subscriptions in the instance.

subscription_id

Removes the subscription with the subscription id subscription_id.

The KILL QUERY NOTIFICATION SUBSCRIPTION statement removes query notification subscriptions without producing a notification message.

subscription_id is the id for the subscription as shown in the dynamic management view sys.dm_qn_subscriptions.

If the specified subscription id does not exist, the statement produces an error.

Permission to execute this statement is restricted to members of the sysadmin fixed server role.

A. Removing all query notification subscriptions in the instance

This example removes all query notification subscriptions in the instance.

KILL QUERY NOTIFICATION SUBSCRIPTION ALL ;

B. Removing a single query notification subscription

This example removes the query notification subscription with the id 73.

KILL QUERY NOTIFICATION SUBSCRIPTION 73 ;

Community Additions

ADD
Show:
© 2015 Microsoft