sp_syspolicy_unsubscribe_from_policy_category (Transact-SQL)

THIS TOPIC APPLIES TO:yesSQL Server (starting with 2008)noAzure SQL DatabasenoAzure SQL Data Warehouse noParallel Data Warehouse

Deletes a policy category subscription for the current database.

Topic link icon Transact-SQL Syntax Conventions


sp_syspolicy_unsubscribe_from_policy_category [ @policy_category = ] 'policy_category'  


[ @policy_category= ] 'policy_category'
Is the name of the policy category subscription that you want to delete. policy_category is sysname, and is required.

To obtain values for policy_category, query the msdb.dbo.syspolicy_policy_categories system view.

Return Code Values

0 (success) or 1 (failure)


You must run sp_syspolicy_unsubscribe_from_policy_category in the context of the database where you want to remove a policy category subscription.


Requires membership in the db_owner fixed database role.


The following example deletes a subscription to the 'Finance' policy category for the specified database.

USE <database_name>;  

EXEC sys.sp_syspolicy_unsubscribe_from_policy_category @policy_category = N'Finance';  


See Also

Policy-Based Management Stored Procedures (Transact-SQL)
sp_syspolicy_subscribe_to_policy_category (Transact-SQL)