Home Microsoft SQL Server DigiMailing iRN Contact
    Keyword



sys.sp_syspolicy_unsubscribe_from_policy_category

  No additional text.


Syntax
CREATE PROCEDURE sys.sp_syspolicy_unsubscribe_from_policy_category
	@policy_category sysname
AS
BEGIN
	IF( @policy_category IS NULL)
	BEGIN	
		RAISERROR(14043, -1, -1, '@policy_category', 'sp_syspolicy_unsubscribe_from_policy_category')
		RETURN(1)
	END

	IF (IS_MEMBER('db_owner') != 1)
	BEGIN
		RAISERROR(21050, -1, -1)
		RETURN(1)
	END
	DECLARE @policy_category_subscription_id INT
	SET @policy_category_subscription_id =
		(SELECT policy_category_subscription_id
			FROM [msdb].[dbo].[syspolicy_policy_category_subscriptions] pgs
			INNER JOIN [msdb].[dbo].[syspolicy_policy_categories] pg
				ON pgs.policy_category_id = pg.policy_category_id
			WHERE pgs.target_type = N'DATABASE' AND
					pgs.target_object = DB_NAME() AND
					pg.name = @policy_category)

	EXEC [msdb].[dbo].[sp_syspolicy_delete_policy_category_subscription] @policy_category_subscription_id
END

 
Last revision 2008RTM
News

  Query a named instance
Sybase+ASE+silent+install
SQL 2008 R2
Deprecated procedures in SQL2008
Reporting Services item-level role definitions
Create all your missing indexes
Converting datetime field
Start MSSQL Server Profiler at time
Replicating MSSQL Server views
Exploring Microsoft Sharepoint
The OLE DB provider "SQLNCLI10" for linked server indicates.
Mobile solar charger
Oracle to SQL Server replication
Cannot insert the value NULL into column
Undocumented Microsoft SQL Server 2008
VMware
Zoekmachine optimalisatie
SQL Servers hidden objects
FckEditor
Flash in Ajax
De hype die AJAX heet
Barcode scannen
MySQL; Gratis, makkelijk en snel!
PHP
sIFR; de combinatie tussen HTML en Flash