September 24, 2008 at 2:17 am
basicly i want to run a job once every 5 minutes that sends an email to an operators list if the result is true or false. the only way i can really see the sql server agent being able to do this is to somehow force a fail and have it email on fail, or is there a smipler way?
September 24, 2008 at 3:31 am
Hi First You have to configure database mail in Management folder after that create a new job in agent , there you will find different options
such as step, schedule,opretaor and notification. which one you can use according to your purpose.
Production DBA
Naginder Pathania
September 24, 2008 at 3:36 am
already doing all of the above. the problem is that a job only has the option to send an email on the following conditions - success, failure or completion. it can't do it based on the results of a query.
I have reporting services installed as well and it's subscription model can't do it either...
September 24, 2008 at 3:58 am
clearly write ur issue and situation . So that i can tell u about exact solution or what do want to capture or process in ur job. you can handle these system stored procs.
September 24, 2008 at 4:31 am
You can use the following SP sp_send_dbmail inside your job/query to send a mail. If you wrap this inside an IF statement the mail is sent when a condition is true (or false, depending on your needs).
Look at BOL for complete syntax.
September 24, 2008 at 4:50 pm
thanks hanshi, works perfectly. there wouldn't happen to be a method that sends a popup via net send would there?
September 24, 2008 at 5:13 pm
Try defining an operator that only receives notifications using net send. Then, use sp_notify_operator to send a notification to that operator.
I haven't tested it myself - but, it should work.
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply