Help with wait command in a trigger

  • Hi,

    I have a trigger that will send a person an email when an event happen. However, I need the SQL server to wait 5 minitues before sending the email (please don't ask why). Please help.

     

    Thuan

  • Create a queue table to hold the details of the email, and have the trigger insert records to this table, along with a timestamp of when the item was queued.

    Then create a SQL Agent job that runs periodically to check queue items that have been queued more than 5 minutes and email them.

     

  • And run the job every 2 minutes at least so that at most there is a 6m59s delay before the queuing and execution.

  • Thank you very much for the helpful suggestions so far.

    Thuan Pham

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply