August 4, 2009 at 11:39 am
I have to set up an email which notifies a user in outlook . I have this table with n columns . For a particular value in 1 of the columns the user needs to get notified .
col1 col2
A 10
B 10
C 20
For any values of 20 in colb the user must be notified of the new row. How do I achieve this .
sql server 2000 and outlook 2003
August 5, 2009 at 8:20 am
First you need to have SQL Mail set up or, I prefer, xp_smtpsendmail (open the link in IE, it doesn't like Firefox or Chrome).
Second, is this only when a new row is inserted with a value of 20 in col2 or whenever a row is inserted or updated with a value of 20 col2?
If you are using stored procedures to do inserts and updates I'd recommend doing the mailing in the stored procedure.
If you are not using stored procedures and you have created date and modified date columns I would recommend a job that uses those dates to send the emails.
If you have none of the above then I would recommend creating a mail queue table that you populate using a trigger on your existing table and a job that reads the mail queue table to send email out. Check out this article[/url] for Trigger advice.
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply