NSSnapshotEvents (Transact-SQL)
Produces the events snapshot report for an instance of Microsoft SQL Server Notification Services. You can use this report to determine how long it has been since an event class has received events from an event provider.
Syntax
[ schema_name . ] NSSnapshotEvents
Return Code Values
0 (success) or 1 (failure)
Result Sets
Column Name | Data Type | Description |
---|---|---|
ApplicationName |
nvarchar(255) |
Name of an application. |
ApplicationActivationState |
nvarchar(255) |
Activation state for the application. The state can be enabled or disabled. |
EventActivationState |
nvarchar(255) |
Activation state for events in the application. This value indicates whether events can be submitted programmatically, not event provider activation state. The value can be enabled or disabled. |
EventClassName |
nvarchar(255) |
Name of an event class within the application. |
LastTimeEventBatchCollected |
datetime |
Date and time at which the last event batch was collected for the event class. |
SecondsSinceEventBatchCollected |
int |
Elapsed time, in seconds, since the last event class was collected for the event class. |
LastEventBatchEventCount |
bigint |
Number of events collected in the last event batch for the event class. |
LastEventBatchProvider |
nvarchar(255) |
Name of the event provider that submitted the last event batch for the event class. This value is NULL if the events were directly inserted into the <EventClassName> view. |
Remarks
Notification Services creates the NSSnapshotEvents stored procedure in the instance database when you create the instance. When you update the instance, Notification Services recompiles the stored procedure.
This stored procedure is in the instance schema, which is specified by the SchemaName element of the instance configuration file (ICF). If no schema name is provided, the default schema is dbo.
The result set is ordered by the ApplicationName value, and then by the EventClassName value.
Permissions
Execute permissions default to members of the NSAnalysis database role, db_owner fixed database role, and sysadmin fixed server role.
Examples
The following example produces the events snapshot report for all applications hosted by an instance. The instance uses the default database settings, which places all instance objects in the dbo schema.
EXEC dbo.NSSnapshotEvents;
See Also
Reference
Notification Services Stored Procedures (Transact-SQL)
Other Resources
Notification Services Performance Reports
SchemaName Element (ICF)