December 16, 2002 at 10:58 pm
Hai,
I want to create a Trigger on a Table. Whenever a New row inserted into the table, the trigger will fire an email to a Database Administrator. How can I accomplish this one?
Thanks in advance
Regards
Vijay Babu
December 17, 2002 at 2:50 am
If your DBA allows it, you can call xp_sendmail to send the email, but access will need to be granted for that xp to any user that inserts into the table.
What out if you are running sql 2000 sp2 as there are some issues with using that stored procedure.
Steven
December 17, 2002 at 4:10 am
You also have the option of using CDOs AND CDONTs to send via SMTP. Or better to cut down on contention and other issues write message to a table and have a process in SQl Agents Jobs run periodically to pick the information up and send either way.
December 17, 2002 at 8:10 pm
Our office loves using xp_sendmail for business flow notifications. An overview can be found at:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_xp_aa-sz_6hbg.asp
Everett Wilson
ewilson10@yahoo.com
December 18, 2002 at 4:46 am
I'd recommend doing it only for tables with low numbers of inserts, xp_sendmail isn't the quickest call in the world. Also have to decide what to do if multiple rows inserted in the transaction, whether to send one email or cursor through and process each separately.
Andy
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply