Evil Overlord - 2009-10-01

I need to log historical changes to personal details in a table but don't really care about insertions or deletions.

I notice that the default trigger includes in it's update section something like:

    INSERT INTO
    (,,)
    VALUES
    (@FIELD1, @FIELD2, @FIELD3)

This logs the current value the data was changed to but I would prefer a historical record (as the current value is already in the main table).

Is it possible to have the option in the preferences to change this to:

    INSERT INTO
    (,,)
    VALUES
    (@FIELD1_OLD, @FIELD2_OLD, @FIELD3_OLD)

I'm changing my triggers manually at the moment but it would be nice to have a historical log option as well as a changes log.

As a seperate issue, how about adding a

    IF EXISTS (SELECT * FROM SYSOBJECTS WHERE NAME = 'XXX')
    DROP VIEW/TABLE/TRIGGER XXX
   

or something similar before each CREATE statement?

I know you can generate DROP scripts but it'd be nice to be able to recreate triggers without that extra step.