Re: SQL 2005 & server side trace
- From: "Kalen Delaney" <please_reply_on_newsgroups@xxxxxxxxxx>
- Date: Fri, 5 Mar 2010 14:44:22 -0800
Joe
This is a known limitation of traces. To get multiple filters defined with the correct and/or combinations is very difficult and in some cases impossible to get what you want. You might consider capturing everything from dbid 29 and loading it into a table, and then use can use SQL statements to get the rows you want. Or, if that makes your trace too big, consider capturing two traces, one with dbid 29 and joesmith and the other dbid 29 and sa. You can then combine these two.
--
HTH
Kalen
----------------------------------------
Kalen Delaney
SQL Server MVP
www.SQLServerInternals.com
"GrampaJoe" <joeydba@xxxxxxxxx> wrote in message news:be54cfb6-c2da-499d-835d-549884905969@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,
I am trying to set up a server side trace where it will collect logins
and objects access by a list of users in one database. The problem I
am running into is using more then 2 sp_trace_setfilter to capture
more then 1 user name. Either I get nothing or get everyone and that
is not what I want.
Here is a snippet of the code I'm running via a query window.
exec sp_trace_setfilter @traceid, 3, 1, 0, 29 -- dbid for
MyDatabase
exec sp_trace_setfilter @traceid, 11, 1, 6, N'%joesmith%' -- any
version of a user with joesmith
exec sp_trace_setfilter @traceid, 11, 1, 6, N'%sa%' -- any login with
'sa' in it's name.
My problem is that I can capture either the "dbid 29 and %joesmith%"
or "dbid 29 and %sa%".
But I can not capture "dbid 29" and/or "%joesmith%" and/or "%sq%".
Meaning that I can not get the filters set correctly to only capture
any value of the 3 filters. I have played with the logical_operator
of "AND (0) or OR (1)" in many different ways, none of which worked.
This is on a SQL 2005 SP3 server.
Any help sure would be nice.
Thanks,
Joe
.
- Follow-Ups:
- Re: SQL 2005 & server side trace
- From: GrampaJoe
- Re: SQL 2005 & server side trace
- References:
- SQL 2005 & server side trace
- From: GrampaJoe
- SQL 2005 & server side trace
- Prev by Date: Re: copy entire database over to linked server
- Next by Date: Re: Change sa password SQL Server 2005
- Previous by thread: SQL 2005 & server side trace
- Next by thread: Re: SQL 2005 & server side trace
- Index(es):
Relevant Pages
|