SQLTeam.com | Weblogs | Forums

Sql job to send an email on table update


#1

Hi,

I need to create a SQL job to send an email to some dept whenever two sql tables are changed (updated)

Basically

I created a audit table with columns user, last_updatedate, old_value and new_value,and a identity column

and also Created a two update triggers whenever target 2 tables are updated log the information to audit table.

Basically I am looking for a code whenever a new row inserted into audit table send an email with the data. and put this code into sql job to run as per schedule. Thanks


#2

You seem to be asking for two, conflicting things:

  1. whenever a new row is inserted into the audit table, send an email (a trigger would do this)
  2. An Agent job that does something (not sure what) on a schedule

Can you elaborate a bit?