Creating an Audit Trail..

  • We are processing T-SQL batches (series of modifications to table data).

    Ultimately I would like to build in a fail safe that allows us the ability to Roll-Back, or undo a batch if needed.

    Batch A fires

    We realize Batch A was bad and need to undo effects A made

    Does anyone know of a way to do this easily?

    I almost wish there was a way I could save the portion of the log the related to the Batch and then use that to undo.

     

    Any ideas??

    THank You!

  • That all depends on what the bacth is doing!

    How complex are the batches?


    Kindest Regards,

  • Thank you for the reply.

    The batches are just adding and / or modifying table rows in a table.

    Thank you!

  • We've done this by using a 'data checking' table. The data rows which are candidates are put into the working 'data checking' table which has been declared the VARCHAR columns. Each data column is then checked to determine if it contains valid data; columns that are supposed to be numeric are numeric, columns that are supposed to be valid dates are, columns contain appropriate values (foreign keys, list if acceptables, etc.). If the entire batch 'passes' the checks then the data is moved into the 'permanent' table; otherwise it is errored. out.

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply