Home All Groups Group Topic Archive Search About

SQL Profiler Filters

Author
18 Jan 2005 6:45 PM
Derek Ruesch
I have a SQL Profiler trace that has the following filters applied:

Application Name  Not Like  SQL Profiler
TextData  Not Like  SELECT

I want this trace to not include SQL Profiler events and SQL "Select"
statements.

The trace does not show SQL Profiler events but it does still show "Select"
SQL statements. Why is it still showing SQL Select statements?

Thanks for the help.

Derek Ruesch

Author
18 Jan 2005 7:38 PM
Adam Machanic
Try:

TextData Not Like '%SELECT%'

--
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--


Show quote
"Derek Ruesch" <DerekRue***@discussions.microsoft.com> wrote in message
news:34906C19-26EE-4926-B80F-B6B4E0C45879@microsoft.com...
> I have a SQL Profiler trace that has the following filters applied:
>
> Application Name  Not Like  SQL Profiler
> TextData  Not Like  SELECT
>
> I want this trace to not include SQL Profiler events and SQL "Select"
> statements.
>
> The trace does not show SQL Profiler events but it does still show
"Select"
> SQL statements. Why is it still showing SQL Select statements?
>
> Thanks for the help.
>
> Derek Ruesch
Author
18 Jan 2005 8:35 PM
Derek Ruesch
This did not work. After this did not work I tried
TextData  LIKE  UPDATE and TextData  LIKE  '%UPDATE%' (so that the trace
would only track UPDATE sql statements). This blocked all SQL statements,
including UPDATE statements.

Any more ideas?

Thank you for your help.

Derek

Show quote
"Adam Machanic" wrote:

> Try:
>
> TextData Not Like '%SELECT%'
>
> --
> Adam Machanic
> SQL Server MVP
> http://www.sqljunkies.com/weblog/amachanic
> --
>
>
> "Derek Ruesch" <DerekRue***@discussions.microsoft.com> wrote in message
> news:34906C19-26EE-4926-B80F-B6B4E0C45879@microsoft.com...
> > I have a SQL Profiler trace that has the following filters applied:
> >
> > Application Name  Not Like  SQL Profiler
> > TextData  Not Like  SELECT
> >
> > I want this trace to not include SQL Profiler events and SQL "Select"
> > statements.
> >
> > The trace does not show SQL Profiler events but it does still show
> "Select"
> > SQL statements. Why is it still showing SQL Select statements?
> >
> > Thanks for the help.
> >
> > Derek Ruesch
>
>
>
Author
18 Jan 2005 8:56 PM
Adam Machanic
Did you by any chance include the single-quotes?


--
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--


Show quote
"Derek Ruesch" <DerekRue***@discussions.microsoft.com> wrote in message
news:D729EBE1-5832-4EE4-BC0F-BB00958703E7@microsoft.com...
> This did not work. After this did not work I tried
> TextData  LIKE  UPDATE and TextData  LIKE  '%UPDATE%' (so that the trace
> would only track UPDATE sql statements). This blocked all SQL statements,
> including UPDATE statements.
>
> Any more ideas?
>
> Thank you for your help.
>
> Derek
>
> "Adam Machanic" wrote:
>
> > Try:
> >
> > TextData Not Like '%SELECT%'
> >
> > --
> > Adam Machanic
> > SQL Server MVP
> > http://www.sqljunkies.com/weblog/amachanic
> > --
> >
Author
18 Jan 2005 8:47 PM
Hugo Kornelis
On Tue, 18 Jan 2005 14:38:29 -0500, Adam Machanic wrote:

>Try:
>
>TextData Not Like '%SELECT%'

Hi Adam,

But wouldn't that exclude all statements with subqueries as well?

Best, Hugo
--

(Remove _NO_ and _SPAM_ to get my e-mail address)
Author
18 Jan 2005 8:54 PM
Adam Machanic
Good point --

Yet another reason not to use ad hoc SQL :-)

--
Adam Machanic
SQL Server MVP
http://www.sqljunkies.com/weblog/amachanic
--


Show quote
"Hugo Kornelis" <hugo@pe_NO_rFact.in_SPAM_fo> wrote in message
news:cetqu0l67qon06h8pj50u4v1eonmdpri5k@4ax.com...
> On Tue, 18 Jan 2005 14:38:29 -0500, Adam Machanic wrote:
>
> >Try:
> >
> >TextData Not Like '%SELECT%'
>
> Hi Adam,
>
> But wouldn't that exclude all statements with subqueries as well?
>
> Best, Hugo
> --
>
> (Remove _NO_ and _SPAM_ to get my e-mail address)
Author
18 Jan 2005 9:39 PM
Kalen Delaney
Hi Derek

I am had some problems with multiple filters working correctly together,
especially when you include negatives. There may be a bug in the trace
engine itself or it may be a bug in how Profiler translates your filters to
an underlying trace.

What version are you using? (That info should always be included when asking
for help.)

I presume from  your subject line you are using Profiler, and not a server
side trace. Can you see what trace command your filters are being converted
to?
If you are using SQL 2000, you can. Use the option on the profiler menu to
script the trace, and save the script to a file. Then show us the lines from
the script that include sp_trace_setfilter.

--
HTH
----------------
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com


Show quote
"Derek Ruesch" <DerekRue***@discussions.microsoft.com> wrote in message
news:34906C19-26EE-4926-B80F-B6B4E0C45879@microsoft.com...
>I have a SQL Profiler trace that has the following filters applied:
>
> Application Name  Not Like  SQL Profiler
> TextData  Not Like  SELECT
>
> I want this trace to not include SQL Profiler events and SQL "Select"
> statements.
>
> The trace does not show SQL Profiler events but it does still show
> "Select"
> SQL statements. Why is it still showing SQL Select statements?
>
> Thanks for the help.
>
> Derek Ruesch
Author
19 Jan 2005 5:03 PM
Derek Ruesch
Nevermind this problem. I figured it out on my own. All you need to do is
type in, for example UPDATE%, (without the single quotes sign). This example
will only retrieve "UPDATE" SQL statements.

I do have another question though. Once you have created a trace and then
stopped it. How do you restart it so that you can continue tracing events. I
closed SQL Profiler before I went home last night (this stopped the trace)
and then I wanted to start the trace again this morning. However it only lets
you "replay" the trace file. I don't want to replay the trace file, I want it
to continue tracing events. Is there any way to make it resume tracing events
after you have stopped it or make it trace events even after profiler has
been closed?

Thanks for your help.

Derek Ruesch

Show quote
"Kalen Delaney" wrote:

> Hi Derek
>
> I am had some problems with multiple filters working correctly together,
> especially when you include negatives. There may be a bug in the trace
> engine itself or it may be a bug in how Profiler translates your filters to
> an underlying trace.
>
> What version are you using? (That info should always be included when asking
> for help.)
>
> I presume from  your subject line you are using Profiler, and not a server
> side trace. Can you see what trace command your filters are being converted
> to?
> If you are using SQL 2000, you can. Use the option on the profiler menu to
> script the trace, and save the script to a file. Then show us the lines from
> the script that include sp_trace_setfilter.
>
> --
> HTH
> ----------------
> Kalen Delaney
> SQL Server MVP
> www.SolidQualityLearning.com
>
>
> "Derek Ruesch" <DerekRue***@discussions.microsoft.com> wrote in message
> news:34906C19-26EE-4926-B80F-B6B4E0C45879@microsoft.com...
> >I have a SQL Profiler trace that has the following filters applied:
> >
> > Application Name  Not Like  SQL Profiler
> > TextData  Not Like  SELECT
> >
> > I want this trace to not include SQL Profiler events and SQL "Select"
> > statements.
> >
> > The trace does not show SQL Profiler events but it does still show
> > "Select"
> > SQL statements. Why is it still showing SQL Select statements?
> >
> > Thanks for the help.
> >
> > Derek Ruesch
>
>
>
Author
19 Jan 2005 5:34 PM
Kalen Delaney
Hi Derek

I'm assuming you closed Profiler, or at least the window the trace was
running in. You can stop and restart the same trace over and over only as
long as the window where you defined it is open (so the connection is still
open).  If all you have left is the trace file, you can't rerun the trace.
It would be lilke trying to re-execute a program from submitting the file of
output. You can save the trace definition before you close Profiler, and
then re-open the next day to play a trace with the same definition.

--
HTH
----------------
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com


Show quote
"Derek Ruesch" <DerekRue***@discussions.microsoft.com> wrote in message
news:D33F6E05-943B-4B42-96F0-74E2D87C73AE@microsoft.com...
> Nevermind this problem. I figured it out on my own. All you need to do is
> type in, for example UPDATE%, (without the single quotes sign). This
> example
> will only retrieve "UPDATE" SQL statements.
>
> I do have another question though. Once you have created a trace and then
> stopped it. How do you restart it so that you can continue tracing events.
> I
> closed SQL Profiler before I went home last night (this stopped the trace)
> and then I wanted to start the trace again this morning. However it only
> lets
> you "replay" the trace file. I don't want to replay the trace file, I want
> it
> to continue tracing events. Is there any way to make it resume tracing
> events
> after you have stopped it or make it trace events even after profiler has
> been closed?
>
> Thanks for your help.
>
> Derek Ruesch
>
> "Kalen Delaney" wrote:
>
>> Hi Derek
>>
>> I am had some problems with multiple filters working correctly together,
>> especially when you include negatives. There may be a bug in the trace
>> engine itself or it may be a bug in how Profiler translates your filters
>> to
>> an underlying trace.
>>
>> What version are you using? (That info should always be included when
>> asking
>> for help.)
>>
>> I presume from  your subject line you are using Profiler, and not a
>> server
>> side trace. Can you see what trace command your filters are being
>> converted
>> to?
>> If you are using SQL 2000, you can. Use the option on the profiler menu
>> to
>> script the trace, and save the script to a file. Then show us the lines
>> from
>> the script that include sp_trace_setfilter.
>>
>> --
>> HTH
>> ----------------
>> Kalen Delaney
>> SQL Server MVP
>> www.SolidQualityLearning.com
>>
>>
>> "Derek Ruesch" <DerekRue***@discussions.microsoft.com> wrote in message
>> news:34906C19-26EE-4926-B80F-B6B4E0C45879@microsoft.com...
>> >I have a SQL Profiler trace that has the following filters applied:
>> >
>> > Application Name  Not Like  SQL Profiler
>> > TextData  Not Like  SELECT
>> >
>> > I want this trace to not include SQL Profiler events and SQL "Select"
>> > statements.
>> >
>> > The trace does not show SQL Profiler events but it does still show
>> > "Select"
>> > SQL statements. Why is it still showing SQL Select statements?
>> >
>> > Thanks for the help.
>> >
>> > Derek Ruesch
>>
>>
>>

AddThis Social Bookmark Button