NSSubscriptionConditionInformation (Transact-SQL)

Returns the query used to evaluate a subscription to a subscription class that supports condition actions.

[ application_schema_name . ] NSSubscriptionConditionInformation 
    [ @SubscriptionClassName = ] subscription_class_name, 
        [ @SubscriptionId = ] subscription_identifier

[ @SubscriptionClassName = ] subscription_class_name

Name of a subscription class that supports condition actions. subscription_class_name is nvarchar(255) and has no default value.

[ @SubscriptionId = ] subscription_identifier

Identifier of a subscription. subscription_identifier is bigint and has no default value.

0 (success) or 1 (failure)

Column Name Data Type Description



The query produced by Notification Services from the conditions defined by the user. This query is the same for all subscriptions with the same signature.

You can run the query returned to debug your application. The query runs against the current set of events in the event view, chronicle, or other specified table or view. If there are no current events to process, no results are returned. The query includes other subscription conditions with the same logic template as the requested subscription.

Execute permissions default to members of the NSGenerator and NSRunService database roles, the db_owner fixed database role, and the sysadmin fixed server role.

The following example shows how to run the NSSubscriptionConditionInformation stored procedure for the InventoryTracker sample. The stored procedure is in the NS_InventoryTrackerApplication schema and returns the query for subscription 1 for the InventoryTrackerSubscriptions subscription class.

EXEC NS_InventoryTrackerApplication.NSSubscriptionConditionInformation
    N'InventoryTrackerSubscriptions', 1;

Community Additions