Home Forums SQL Server 2008 T-SQL (SS2K8) Table structure for creating timetable for a school RE: Table structure for creating timetable for a school

  • Nah. Done correctly, audit triggers are fast and a breeze to write. It also depends a bit on whether you're doing "whole row" auditing or "column level" auditing, the later being the more complicated of the two.

    The key to such audits is to never audit INSERTs, which would automatically double the size of the data... one row for the trigger table and one row for the audit table.

    In an audit system, only the "old" data should be in the audit table and whatever the "new" data is will be in the trigger table (the table with the trigger on it). If a row is inserted and never updated, that row won't show up in the audit table. The trigger table becomes a part of the "audit".

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)