Partilhar via


NSSubscriptionConditionInformation (Transact-SQL)

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

Syntax

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

Arguments

  • [ @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.

Return Code Values

0 (success) or 1 (failure)

Result Sets

Column Name Data Type Description

CommandText

nvarchar(max)

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.

Remarks

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.

Permissions

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

Examples

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;

See Also

Reference

Notification Services Stored Procedures (Transact-SQL)

Other Resources

Defining Condition Actions
SchemaName Element (ADF)

Help and Information

Getting SQL Server 2005 Assistance