NSSnapshotProviders (Transact-SQL)
Produces the event providers snapshot report for an instance of Microsoft SQL Server Notification Services. The report contains information about each event provider configured for an instance.
Syntax
[ schema_name . ] NSSnapshotProviders
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 of the application. The state can be enabled or disabled. |
ProviderName |
nvarchar(255) |
Name of an event provider used by the application. |
ProviderActivationState |
nvarchar(255) |
Activation state of the event provider. The state can be enabled, enabled pending, disabled, or disabled pending. |
SystemName |
nvarchar(255) |
Name of the computer system where the event provider is running. |
LastEventClassCollected |
nvarchar(255) |
Name of the event class that collected the last event batch for the event provider. |
LastTimeEventBatchCollected |
datetime |
Date and time at which the last event batch was collected by the event provider. |
SecondsSinceEventBatchCollected |
int |
Elapsed time, in seconds, since the last event batch was collected for the event provider. |
NumberOfEventsInLastEventBatch |
bigint |
Number of events collected in the last event batch. |
Remarks
Notification Services creates the NSSnapshotProviders 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 ProviderName 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 providers snapshot report for all applications hosted by an instance. In this example, the stored procedure (like all other instance objects) is in the FlightInstance schema, as specified in the SchemaName element of the ICF.
EXEC StockInstance.NSSnapshotProviders;
See Also
Reference
Notification Services Stored Procedures (Transact-SQL)
Other Resources
Notification Services Performance Reports
SchemaName Element (ICF)