NSEventBatchDetails (Transact-SQL)
Returns detailed information about an event batch in a Microsoft SQL Server Notification Services application. One result set contains general information about the event batch, such as the event provider name and the time that the event batch was collected. A second result set displays the events that were submitted in the event batch.
Syntax
[ application_schema_name . ] NSEventBatchDetails
[ @EventClassName = ] 'event_class_name' ,
[ @EventBatchId = ] event_batch_id
Arguments
- [ @EventClassName = ] 'event_class_name'
Is the name of an event class. event_class_name is nvarchar(255) and has no default value.
- [ @EventBatchId = ] event_batch_id
Is the unique identifier of an event batch. event_batch_id is bigint and has no default value.
Return Code Values
None
Result Sets
NSEventBatchDetails produces two result sets. The first result set contains general information about the event batch.
Column Name | Data Type | Description |
---|---|---|
ProviderName |
nvarchar(255) |
Name of the event provider that submitted the batch of events. This value is NULL if the events were directly inserted into the <EventClassName> view. |
EventCount |
bigint |
Number of events in the event batch. |
StartCollectionTime |
datetime |
Date and time that event batch collection started, in UTC (Coordinated Universal Time or Greenwich Mean Time). |
EndCollectionTime |
datetime |
Date and time, in UTC, that event batch collection ended. |
CollectionTimeInMS |
int |
Total time, in milliseconds, to collect the batch of events. |
The second result set contains details about the events submitted in the event batch, ordered by the EventId column.
Column Name | Data Type | Description |
---|---|---|
EventId |
bigint |
ID number used to identify an event. |
Event_class_field_name |
application-defined |
Name of an event class field, as defined in the application definition file (ADF). Each field in the event class is represented by a column in the result set. |
Remarks
Notification Services creates the NSEventBatchDetails stored procedure in the application database when you create the instance. When you update the application, Notification Services recompiles the stored procedure.
This stored procedure is in the application's schema, which is specified by the SchemaName element of the application definition file (ADF). If no schema name is provided, the default schema is dbo.
Permissions
Execute permissions default to members of the NSAnalysis database role, the db_owner fixed database role, and the sysadmin fixed server role.
Examples
A. Using the Default Application Schema
The following example shows how to produce the event batch details report. The application uses the default SchemaName settings, which places all application objects in the dbo schema.
The report contains two result sets. The first shows the event provider and event collection information for the event batch, and the second shows the events submitted in the event batch.
EXEC dbo.NSEventBatchDetails
@EventClassName = N'StockEvents',
@EventBatchId = 1;
B. Using a Named Application Schema
The following example shows how to produce the event batch report when the stored procedure (like all other application objects) is in the Stock schema, as specified in the SchemaName element of the ADF.
EXEC Stock.NSEventBatchDetails
@EventClassName = N'StockEvents',
@EventBatchId = 1;
See Also
Reference
Notification Services Stored Procedures (Transact-SQL)
Other Resources
Notification Services Performance Reports
SchemaName Element (ADF)