Monday, February 20, 2012

Q: trigger and notification

Hello,
How would you create a trigger on a table modification/delete/add and send
an intication do an e-mail address?
Thanks,
JimHi Jim,
I guess you are looking at something like this...
CREATE TRIGGER tr_test
ON yourtable
FOR INSERT, UPDATE, DELETE
AS
EXEC master..xp_sendmail 'email address',
'Data inserted, modified or deleted from yourtable'
Also look at BOL for "CREATE TRIGGER"
Thanks
Yogish|||I get this error message after calling stored procedure.
xp_sendmail: Either there is no default mail client or the current mail
client cannot fulfill the messaging request. Please run Microsoft Outlook an
d
set it as the default mail client.
"Yogish" wrote:

> Hi Jim,
> I guess you are looking at something like this...
> CREATE TRIGGER tr_test
> ON yourtable
> FOR INSERT, UPDATE, DELETE
> AS
> EXEC master..xp_sendmail 'email address',
> 'Data inserted, modified or deleted from yourtable'
> Also look at BOL for "CREATE TRIGGER"
> --
> Thanks
> Yogish
>|||You need to configure SQL Mail. You can find the steps
outlined in the following article:
INF: How to Configure SQL Mail
http://support.microsoft.com/?id=263556
-Sue
On Wed, 12 Jan 2005 13:41:06 -0800, JIM.H.
<JIMH@.discussions.microsoft.com> wrote:
[vbcol=seagreen]
>I get this error message after calling stored procedure.
>xp_sendmail: Either there is no default mail client or the current mail
>client cannot fulfill the messaging request. Please run Microsoft Outlook a
nd
>set it as the default mail client.
>"Yogish" wrote:
>

No comments:

Post a Comment