SQL Server Profiler - 如何过滤跟踪以仅显示包含 DELETE 语句的 TSQL? [英] SQL Server Profiler - How to filter trace to only display TSQL containing a DELETE statement?
问题描述
我有一个 SQL 跟踪设置来监控所有发送到单个数据库的 TSQL.但是,我只关心发出的删除"TSQL 语句.有什么方法可以过滤以仅向分析器报告这些类型的语句?谢谢!
I have a SQL Trace setup to monitor all TSQL being issued to a single database. However I only care about 'DELETE' TSQL statements being issued. Is there any way I can filter to just reporting these type of statements to the profiler? Thanks!
推荐答案
设置跟踪时,转到事件选择并仅选择 TSQL->Batch completed
.现在点击 column filters
按钮并选择 TextData
-> Like
并写入 %delete%
.应该这样做.
When setting up your trace, go to event selection and select only TSQL->Batch completed
. Now click the column filters
button and choose TextData
-> Like
and write %delete%
. That should do it.
EDIT:在 delete
周围添加百分号 (%
),因为它们是使其工作所必需的.
EDIT: Added percent signs (%
) around delete
because they are needed to make it work.
这篇关于SQL Server Profiler - 如何过滤跟踪以仅显示包含 DELETE 语句的 TSQL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!