KILL QUERY NOTIFICATION SUBSCRIPTION (Transact-SQL)
Applies to: SQL Server Azure SQL Managed Instance
Removes query notification subscriptions from the instance. This statement can remove a specific subscription or all subscriptions.
Transact-SQL syntax conventions
Syntax
KILL QUERY NOTIFICATION SUBSCRIPTION
{ ALL | subscription_id }
Note
To view Transact-SQL syntax for SQL Server 2014 (12.x) and earlier versions, see Previous versions documentation.
Arguments
ALL
Removes all subscriptions in the instance.
subscription_id
Removes the subscription with the subscription id subscription_id.
Remarks
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 (Transact-SQL).
If the specified subscription id does not exist, the statement produces an error.
Permissions
Permission to execute this statement is restricted to members of the sysadmin fixed server role.
Examples
A. Removing all query notification subscriptions in the instance
The following example removes all query notification subscriptions in the instance.
KILL QUERY NOTIFICATION SUBSCRIPTION ALL ;
B. Removing a single query notification subscription
The following example removes the query notification subscription with the id 73
.
KILL QUERY NOTIFICATION SUBSCRIPTION 73 ;
See Also
Phản hồi
https://aka.ms/ContentUserFeedback.
Sắp ra mắt: Trong năm 2024, chúng tôi sẽ dần gỡ bỏ Sự cố với GitHub dưới dạng cơ chế phản hồi cho nội dung và thay thế bằng hệ thống phản hồi mới. Để biết thêm thông tin, hãy xem:Gửi và xem ý kiến phản hồi dành cho