Home Forums Programming General SQL SERVER 2000 trigger for Audit trail RE: SQL SERVER 2000 trigger for Audit trail

  • Something like this should get you most of the way:

    create TRIGGER [name] ON

    FOR INSERT

    AS

    update

    set created_by = SUSER_SNAME(),

    last_modified_by = SUSER_SNAME(),

    date_created = GETDATE(),

    date_last_modified = GETDATE()

    from inserted

    where

    .Seqno = inserted.seqno;

    create TRIGGER [name] ON

    FOR UPDATE

    AS

    update

    set last_modified_by = SUSER_SNAME(),

    date_last_modified = GETDATE()

    from inserted

    where

    .Seqno = inserted.Seqno;

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.