May 15, 2013 at 7:36 am
Hello,
I am trying to exclude some users from being captured from a trace.
If the traceid I have is 2
I see that the syntax mentions this below so would these be the parameters for each user?
exec sp_trace_setfilter 2, 10, 0, 7, N'userhere'
-- EXEC sp_trace_setfilter
-- @trace_id = 2,
-- @columnid = 10, --app name column
-- @logicaloperator = 1, -- logical "or"
-- @comparisonoperator = 0, -- equals
-- @value = N'SQL Profiler'
Thanks
May 15, 2013 at 10:40 am
You need to change the column id parameter to the one you need.
SELECT
*
FROM
sys.trace_columns AS TC
WHERE
name LIKE '%name'
My guess is that you want NTUserName which is column id 6.
I'd recommend using the profiler GUI to define your trace. Start and stop it, then go to File -> Export -> Script Trace Definition
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
May 15, 2013 at 11:17 am
If i want to exclude SYSLOGINS , not necessarily NTusernames as defined within the instance it looks like its this
exec sp_trace_setfilter @TraceID, 11, 0, 7, N'xxxxxxx'
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply