Home > Archive > MS SQL Server > August 2005 > Email results from trigger tables









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Email results from trigger tables
Shawn Barrow

2005-08-31, 11:23 am

I'm trying to e-mail the results of a trigger that fires on an employee
table. I'm trying to included the results of either the DELETED or INSERTED
tables, but nothing is returned. Can xp_sendmail include DELETED or INSERTED
table queries in the @query = parameter?

I'm trying to send an e-mail to someone whenever a new employee is added or
deleted.

Thanks.
Jens Süßmeyer

2005-08-31, 11:23 am

Regardless that doesn´t work because the new session with XP_sendmail won´t
know about your deleted tables, the action you want to perform is not
preferable, because mail sending will be done synchronisly. So if your
mailserver is stuck in a problem and need 5 minutes for sending a mail (for
some reason) your transaction will hold on for that time, if the process
throws an error, your transaction might rollback. You don´t want that, erh ?
I would suggest (as this is not time critical) to write the data in a table
which is regulary checked for content to be sent.


--
HTH, Jens Suessmeyer.

---
http://www.sqlserver2005.de
---


"Shawn Barrow" wrote:

> I'm trying to e-mail the results of a trigger that fires on an employee
> table. I'm trying to included the results of either the DELETED or INSERTED
> tables, but nothing is returned. Can xp_sendmail include DELETED or INSERTED
> table queries in the @query = parameter?
>
> I'm trying to send an e-mail to someone whenever a new employee is added or
> deleted.
>
> Thanks.

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com