Monitor a specific row in a table

  • In one of our tables, we have one static row. The columns of this static  row should not get updated in any cases. However we notice that two columns (datatype -money) in the static row gets updated occasionally. This is an error which we are not able mimic.

    We want to setup a trace or any other method to monitor this specific static row of the table  and identify the procedure which updates values to this static row/columns.

    Need forum members assitance on this

     

    thanks

    rangark

     

  • If you start a Profiler trace, filtering on the dbid and objectid for the table in question, and capturing any T-SQL commands against it, you ought to catch the culprit. This trace will record very little activity (I would guess), so you can probably leave it running for several days with no problems.

    Include the columns ProgramName, HostName, username and LoginName in your trace.

  • Hi Philip,

    Thanks for your suggestion.

    The only issue is the table is question is the most accessed table and with plenty of inserts/updates.  The trace file will be very huge for review. Is there any other method .

    thanks

  • Why not put a trigger on the table to capture when the change is happening and who is executing it.  You could also use the trigger to rollback any transaction hitting against that row of data.

    Tom

  • create a trigger.........

    -Krishnan

Viewing 5 posts - 1 through 5 (of 5 total)

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