remidian.com

play Mount of Olives

remidian is remi visser, oracle dba contractor from the Netherlands you can browse my work related braindumps, read my resume or contact me

home mssql SQL Trace

Use filters to keep your traces meaningfull

Say you have an sql trace for the event ‘TSQL SQL:StmtCompleted’ you are, most probably, NOT interested in the sql statements executed through the SQL Server Agent for instance. Filters below remove most of the unwanted ‘internal’ tsql.

The contents of your tracefile will become more meanigfull and not unimportant small …

Filter out ‘internal’ sql server proceses

Filter on ‘ApplicationName’
-- --
-- ApplicationName
 
-- SQL Profiler sessions
exec sp_trace_setfilter @TraceID, 10, 0, 7, N'SQL Profiler'
 
-- SQL executed by the SQL Agent
exec sp_trace_setfilter @TraceID, 10, 0, 7, N'SQLAgent%'
exec sp_trace_setfilter @TraceID, 10, 0, 7, N'SQLDMO_1%'
 
Filter on ‘LoginName’
-- --
-- LoginName
 
exec sp_trace_setfilter @TraceID, 11, 0, 7, N'remivisser'
exec sp_trace_setfilter @TraceID, 11, 0, 7, N'<username>'

No Comments, Comment or Ping

Reply to “Use filters to keep your traces meaningfull”