Trouble creating a SQL SCRIPT - TechRepublic
General discussion
May 16, 2006 at 05:36 AM
rheal.dugas

Trouble creating a SQL SCRIPT

by rheal.dugas . Updated 20 years, 1 month ago

Trouble creating a SQL SCRIPT
I am in desperate need of some help creating a way to send out a email if one of my dispatches is not picked up.

I have created a database that dispatches calls to onsite analyst. When a request is entered it automaticly sends a email out to the analyst for that district. They reply to the request via a link in the email and that updates my DB filing a field (ACEPTEDDATE) that they have accepted it.
What I need is a trigger or job that will send that request out again if it is not picked up after one hour and also to send a email to their manager if it is not picked up within 2 hours.
The fields that I have are DATECREATED, ACEPTEDDATE, SENT
I would like to look at the time in DATECREATED and compare it to the current time and if it is one hour or more old and ACCEPTEDDATE is null put a number “1” into the SENT field. Once this happens it will send out a email to the same person. When the DATEDCREATED is 2 hours old, do the same thing but put a “2” in the SENT field.I have the script working for sending out emails, just need a way to trigger it.
Thank You

This discussion is locked

All Comments