16

I am trying to identify SQL INSERTS that occur when a record is viewed from a Windows application. In SQL Profiler I have a long list of stored procedures that fire when the record is viewed, however it is very cumbersome to identify the stored procedure then locate the inserts, then find the stored procedure in the object explorer (even with filters).

Is there a way for me to see all SQL commands on a line item instead of a stored procedure? And then filter by INSERT statements?

Thanks for any assitance!

user53885
  • 3,809
  • 11
  • 33
  • 43

2 Answers2

25

Try watching the events SP:StmtStarting and SQL:StmtStarting, include column TextData, and set a Column Filter for TextData with the Like set to %insert%.

This may include some false positives like references to the "inserted" table in a trigger, etc.

  • I don't know that I have this event. All the rows where a SP is run, the Event Class is RPC:Starting – user53885 Mar 09 '10 at 15:23
  • 2
    Select the "Show All Events" checkbox on the Events Selection tab. –  Mar 09 '10 at 15:42
  • @DyingCactus, is it possible to set filter for insert as well as update statements in the same running trace ? – Aditya Mar 18 '16 at 09:22
12

Just adding some screenshots to the above answer:

Trace Details

Event Selection

Filter Text Data

Isaiah4110
  • 9,855
  • 1
  • 40
  • 56