Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Send an alert if pending is more thatn 10 min

Author  Topic 

haseena
Starting Member

2 Posts

Posted - 2009-05-01 : 11:51:06
Hi There,
I am trying to accomplish a task …

In my table I have a status column and if it shows pending status for more than 10 minutes I should get an alert… I would really appreciate your help.
I tried something but it is not working the way I wanted

I‘ve created a job to run after every 15 minutes but some time my job starts at the same time when the column is updated as pending and stays there only for a minute but I get the alert because it check the condition which is pending and sends an alert.. I need something which checks the actual time when it shows up and stays there for more than 10 minutes


My Code :

if exists (select * from JobStats where Status like '%Pending%')

begin

EXEC sendmail_Haseena 'Haseena@xyz.com', 'Haseena@xyz.com',null ,null,'Status is pending for the last 10 minutes--- please verify’
End

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-05-07 : 13:42:12
have an audit column in your table like dateadded which gets populated by current date value during insert. then in your job which runs at a convienient frequency check for records with dateadded value more than 10 mts and send alert for them.
Go to Top of Page
   

- Advertisement -