Use profiler SPs to log altering of records in user DB

  • I am using sp_trace_* extended stored procedures to perform audit trace.

    The requirement is to log activities that selecting or altering records in user tables in non-system databases.

    Is there a filter or customization of events in profiler stored procedures that can achieve this?

  • You can use filter on TextData column.

    If the client side calls stored procedures, you can trace Stored Procedures-->RPC:Completed and set the SP name as filter.

    If the client sides send adhoc sql statement, you can trace TSQL-->SQLStmtCompleted. The filter can be something like ''%YourTableName%".

     

  • Thanks, Enthusiast

    I am thinking is there a more generic way of achieving this rather than hardcoding the table name in filter. Reason because if new tables are created the filter need to get updated, kind of cumbersome.

    I am sure other people out there may have solution to this issue before.

     

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

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