I am using SQL Server 2005...
I want to monitor table1 with a trigger for an update. On the occurrence of this update, I will check another table (table2), using the data from table2 I place an item in the queue to execute at a variable date in the future. Could be 10 seconds from now, or 2 hours, this date is determined from checking the data in table2. There is a chance the trigger for table1 could execute again before the item that was placed in the queue is processed. In this case, the item in the queue needs to be removed and a new item will be placed in the queue.
Process:
table1 is updated table1's trigger fires and queries table2 to determine a timestamp. This timestamp and code are added to the queue. Something monitors this queue and executes the code at the determined timestamp. If table1 is updated before the item is retrieved from the queue, that item is removed and a new item added to the queue.
Is there is a messaging service out there that will monitor the a date and execute on that date or should I create a new sql job everytime this trigger is fired? Or are there other options? This needs to be scalable.
I hope I was able to explain my problem, if you have any questions let me know. Thanks for any help you can offer.