Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2003
    Posts
    1

    Unanswered: Data modification tracking

    Hi,

    We have a little problem with some data in a particular table. One day the data is ok, and the other day it is not. To be able of trapping the data when it is changing, I was thinking for a trigger.

    I could used the profiler, but Profiler tends to show too much data which would be too hard to manage.

    With the Trigger, I can go check at the sysprocesses to know which program name has run the problematic query and even capture the computer name. (I haven't construct the trigger yet, but by searching the sysprocesses for runnable process I think I can find the right path to the program running the problematic query.)

    The problem is that I will need to know the problematic query. Is there a way to know, within the trigger, which query fired the current trigger ?

    Thanks in advance

    Francois

  2. #2
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    The trigger can't tell who fired it, but you can easily insert some code in your procedure that will insert an entry into an audit log, or update a LastProcessToMessWithThisData field in your table.

    Use the trigger for maintaining to audit columns in your table: Modified (DateTime) and Modifier (nvarchar(50)).

    blindman

  3. #3
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    The trigger doesn't know what process changed the data, but you can use it to track the system user and the time the change occured.

    Try adding some code to your stored procedure so that it logs its execution in an audit table.

    blindman

  4. #4
    Join Date
    Jun 2003
    Location
    Ohio
    Posts
    12,592
    Provided Answers: 1
    The trigger doesn't know what process changed the data, but you can use it to track the system user and the time the change occured.

    Try adding some code to your stored procedure so that it logs its execution in an audit table.

    blindman

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •