How to profile for one table in SQL Server?

csbfibhn  于 2023-08-02  发布在  SQL Server
关注(0)|答案(2)|浏览(139)

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

ua4mk5z4

ua4mk5z41#

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%".

nbysray5

nbysray52#

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

相关问题