Audit Stamps

  • I want all the tables to have audit stamps. I've included four fields for this. They are:

    CreateDate datetime

    CreateUserNamenvarchar(256)

    LastModifiedDatedatetime

    LastModifiedUserNamenvarchar(256)

    I am thining of having insert trigger and update trigger for the dates. I will be passing the UID to my SP in order to update it. Are there more fields that I should include and more importantly, is there a better way of doing this?

  • My approach to audits is answering all relevant questions: who, what, when, where, and sometimes I add a how and why as well for a comment type of field.  I like to keep an audit of everytime a record is touched, not just the first and last time.  This is not for everybody because it can create a large amount of audit information to be collected.  A table would have a companion TableAudit which contains all audit information for that table.  As far as triggers vs other solutions it depends on whether you want the auditing always or only through the application.

     

    Vlad

    http://www.logicmagic.com

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

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