Creates a new event batch, obtains a set of events from a query and then submits those events, optionally runs a post-processing query, and then closes the event batch. Using a query as the event source enables you to submit multiple events at one time, unlike the NSEventWriteEventClassName stored procedure.
- [ @ProviderName = ] 'provider_name'
Is the name of the event provider that is submitting the events. provider_name is nvarchar(255) and must be one of the event providers specified in the application definition file (ADF).
- [ @EventsQuery = ] 'selection_query'
Is the text of the Transact-SQL query used to select the records to be submitted as events. The schema of the records generated by the query must match the schema of the event table to which they are being submitted. selection_query is nvarchar(4000).
- [ @PostQuery = ] 'post_processing_query'
Is the text of a Transact-SQL query used to do any post-processing cleanup or state maintenance, like updating chronicle tables or deleting any temporary objects. post_processing_query is nvarchar(4000).
Microsoft SQL Server Notification Services creates the NSEventSubmitBatchEventClassName 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.
To submit individual events to an application using Transact-SQL, use NSEventBeginBatchEventClassName to open the batch, NSEventWriteEventClassName to write individual events, and NSEventFlushBatchEventClassName to close the event batch.
The following example shows how to use the NSEventSubmitBatchStockEvents stored procedure to obtain stock names and prices from the Stocks table of the Market database, and then write the data to the NSStockEventsEvents table. The query specifies an empty post-processing query.
The application uses the default SchemaName settings, which places all application objects in the dbo schema.
EXEC dbo.NSEventSubmitBatchStockEvents @ProviderName = N'StockEP', @EventsQuery = 'SELECT StockSymbol, StockPrice FROM Market.dbo.Stocks', @PostQuery = '';
ReferenceNotification Services Stored Procedures (Transact-SQL)
Other ResourcesNotification Services Performance Reports
SchemaName Element (ADF)