Exception reports

Discussion in 'microsoft.public.sqlserver.dts' started by Jackie Smith, Oct 25, 2010.

  1. Jackie Smith

    Jackie Smith Guest

    Hi there,
    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
    recipients.

    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
    temporary table.
    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
    email

    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

    TIA
     
    Jackie Smith, Oct 25, 2010
    #1
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.