Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SQL Server Profiler - How to filter trace to only display TSQL containing a DELETE statement?

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!

like image 268
atconway Avatar asked Oct 26 '11 13:10

atconway


People also ask

Can I delete SQL Server Profiler trace data File?

trc files are safe to delete. . trc files generated by SQL Server in process of saving events to a physical file without using the Profiler client tool.


1 Answers

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: Added percent signs (%) around delete because they are needed to make it work.

like image 71
Klaus Byskov Pedersen Avatar answered Sep 19 '22 05:09

Klaus Byskov Pedersen