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!
SQL Server Profiler - How to filter trace to only display TSQL containing a DELETE statement?
Asked Answered
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.
OK did exactly that, but it did not appear to work. Not using the trace properties but if I just go to 'File' -> 'Find' and type in 'delete', search in column 'TextData' it finds the word DELETE in any part of the TSQL. If I add that filter exactly as you mentioned (great easy to follow directions, thanks) it does not pick up anything. Added the filter on SQL:BatchCompleted Like ---> delete. Any ideas? –
Complaisance
Hmmmm... instead of just
delete
try %delete%
–
Zielinski @Complaisance Yup... just tried it out. You definitely need the % signs. –
Zielinski
For me I had to have the RPC:Completed row selected, rather than SQL:BatchCompleted as I was looking for a sproc call. –
Clarify
© 2022 - 2024 — McMap. All rights reserved.