Database Design, "Build Subscription Apps," by Bob Beauchemin [Visual Studio Magazine, April 2003]

CreateInventoryDB.sql contains:
 1. SQL statements to create an inventory database and a table.
 2. SQL statements to create a SQL trigger that actually IS a custom Notification Services event provider.

On every insert and update to the inventory table, the trigger fires and inserts an event batch into Notification Services event table. Note that this uses the stored procedure InventoryInstanceInventory..NSEventWriteInventoryEvents rather than writing directly to the table.

This can be used with any Notification Services application and any database table. You might have to change the name of the stored procedures invoked by the trigger to match your application and event tables.
