Audit Functionality

  • Hi,

    I am trying to create a trigger to do the auditing of changes in other tables but I am unable to store the specific changes occured in those tables to my audit details column e.g.:

    ---Trigger details for Insert, Update

    INSERT dbo.AuditTable

    (ID, AudWorkstation, AudTime, AudUser, AudAction, AudDetail)

    SELECT ID, WorkStationID, GETDATE(), LastModified, 'C', 'Missing details part '

    FROM inserted

    Is there a way of getting just the column names that have changed/updated

    and store them into the AudDetail column of my Audit table?

    Thanks

  • Chris, If you search in the above search box for 'audit table' you will see more solutions than you can shake a stick at. I can tell you one thing though, you really do not need to audit inserts, since they will be in your production table, and tracking them will use space.

    Greg

    Greg
    _________________________________________________________________________________________________
    The glass is at one half capacity: nothing more, nothing less.

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

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