Exception reports - 10-25-2010 , 10:39 AM
I'm not sure whether a job or a script is best to do this.
There will be an import of data into one of the databases I support. New
records in this import should be appended to an existing table in my
database. New records added should be sent as an email to certain
Also existing records will need to be updated if there are changes in the
imported file. Any changes should be sent via email to recipients again
showing the state of the record before the update and after the update.
Any pointers as what's best to use/ the steps to take.
For new records...
I'm thinking along the lines of create a job to import the records into a
2nd step is to write a query (left-join) that will insert the new
recordsinto another table
If there are new records (how do I check if recordcount > 0??) then fire
For changed records...
Use the temporary table above
Join on key fields.
Where there are differences in other fields, export the record to a new
table (how do I get the existing data and the changed data exported one
after the other??)
If there are changed records then fire email