I am using SQL Service Broker. I have a queue that another process is adding items to. I want to run a stored procedure whenever items are added to the queue. The procedure will receive the top item from the queue and use its information within the stored procedure. What is the correct syntax for doing something like this? Do I use a typical SQL Trigger or is there something special to use when working with Service Broker queues?
Share
A triggered stored procedure can be specified as part of the queue definition.
See the documentation for
CREATE QUEUE– specifically theACTIVATIONclause.An example from the documentation: