32

How can I add a filter which can trace sql statements for a particular table name?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Dakmaz
  • 429
  • 1
  • 7
  • 16

2 Answers2

44

You can't set filter to trace specific table directly.

What you can do is specify a filter for Text Data:

File -> Properties -> Event Selection -> Column Filters -> TextData -> Like -> [Table Name]

You may find it important to wrap your table's name with wildcard characters: "%table name%".

Ankush Madankar
  • 3,689
  • 4
  • 40
  • 74
7

This is how I could do it....

Choose below events in the profiler:

  • Audit Database Object Access Event
  • Audit Fulltext
  • Audit Schema Object Access Event

Make sure to choose Text Data, under columns.

Then under column filters choose:

  • DatabaseID ---> enter specific databaseID
  • ObjectId ---> enter specific objectID (select from sysobjects for that specific table)
  • ObjectName ---> enter required tablename
Geoff
  • 8,551
  • 1
  • 43
  • 50
Pradeep Kumar
  • 71
  • 1
  • 1