Triger for History Tables (withOut CDC)

  • hey,

    I want to keep a history that includes the following information:

    - Where a user connects to a database

    - Date Change

    - Name of the table performed within change

    - Name of the column was carried out within Change

    - Old Value

    - New value

    I do not want to use CDC because it does not save the user name to make the change.

    Is it possible to create the trigger level of the DB and table? Or operate on multiple tables are set and thus reduce the lines of code?

    I know the use of inserted & deleted but I find it hard to remove from the table or column name.

    I'd love your help

  • The issue with DB triggers is that they only operate on the change of objects, not actual data changes.

    To Monitor data changes you would need to create table level triggers for each table you wish to monitor. However you might want to investigate placing a trigger on a view and using the view to perform the data update.

    I've never used a trigger on a view so don't know if there are any performance implications.

    _________________________________________________________________________
    SSC Guide to Posting and Best Practices

  • I realized, when I am a trigger for each table relevant

    Does anyone have experience with this and can Upload a script example?

    Even if you can figure out what type of a modified cell that will help (varchar, int, bit...)

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

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