Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

SQL Server Profiler Part 2: Custom Templates and Saving Data Expand / Collapse
Author
Message
Posted Sunday, June 14, 2009 11:15 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: 2 days ago @ 8:21 AM
Points: 10,907, Visits: 12,539
Comments posted to this topic are about the item SQL Server Profiler Part 2: Custom Templates and Saving Data



Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

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
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #734792
Posted Wednesday, June 17, 2009 12:19 AM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, March 28, 2014 5:06 AM
Points: 1,204, Visits: 915
Jack, please help me right if maybe this was done at some point but what I would really like to see is you discussing the meaning of all the events and the columns in Profiler. Excuse me also if I am jumping the gun here and it is still to come. If so, then I can't wait for it. I have been using the Profiler and sure enough I understand a lot of what is going on there but I think with a bit more knowledge I will be able to do it even better.


Manie Verster
Developer
Johannesburg
South Africa

I can do all things through Christ who strengthens me. - Holy Bible
I am a man of fixed and unbending principles, the first of which is to be flexible at all times. - Everett Mckinley Dirkson (Well, I am trying. - Manie Verster)
Post #736241
Posted Friday, June 19, 2009 1:19 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: 2 days ago @ 8:21 AM
Points: 10,907, Visits: 12,539
Manie,

I'll add it to my list, although that is more like a book than a SSC article. Have you checked out Brad McGehee's free eBook on Profiler, http://www.sqlservercentral.com/articles/books/65797/? It doesn't go into great detail on the events either, but it might be a good start.




Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

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
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #738593
Posted Friday, June 19, 2009 11:54 PM


Ten Centuries

Ten CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen CenturiesTen Centuries

Group: General Forum Members
Last Login: Friday, March 28, 2014 5:06 AM
Points: 1,204, Visits: 915
Jack Corbett (6/19/2009)
Manie,

I'll add it to my list, although that is more like a book than a SSC article. Have you checked out Brad McGehee's free eBook on Profiler, http://www.sqlservercentral.com/articles/books/65797/? It doesn't go into great detail on the events either, but it might be a good start.

You know what, I actually forgot that I had downloaded his e-book on Mastering Profiler. I would also not expect elaborate explanations but maybe just a little summary of what each event and column mean. I tell you what, I will, with Brad's permission, make up a summary and post it here as an article. Let me just see first what I letting myself in for.


Manie Verster
Developer
Johannesburg
South Africa

I can do all things through Christ who strengthens me. - Holy Bible
I am a man of fixed and unbending principles, the first of which is to be flexible at all times. - Everett Mckinley Dirkson (Well, I am trying. - Manie Verster)
Post #738748
Posted Tuesday, October 20, 2009 7:09 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, October 29, 2009 11:09 AM
Points: 3, Visits: 7
An explanation on the syntax of using column filters would be useful - I've spent over an hour online and cannot find a single article that explains it.

I run a trace, showing thousands of operations, and I want to show only queries that run an update against a single table - eg table_stuff

So I go to Column Filters, select textdata and click on the Like option and then..... nothing.

update table_stuff, 'update table_stuff %', 'update table_stuff', "update table_stuff" all have NO EFFECT on the trace. I cannot find any syntax that actually performs the filtering I want.

Post #805661
Posted Wednesday, October 21, 2009 7:19 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: 2 days ago @ 8:21 AM
Points: 10,907, Visits: 12,539
Mitch,

Sorry to have taken so long to reply, but I just noticed my notification email. Let me first say that I can understand your frustration. It can be very frustrating trying to get the correct filter in place. In the examples you list none would catch this statement:

UPDATE 
table_stuff
SET a = b

My best suggestion for your situation would be to be liberal with your use of the wildcard (%). You could have some spaces before the code or extra spaces between so I'd recommend something like this:

%update%table_stuff%


Which should capture any possible combination of spaces.

Through a little testing it also appears (I don't know for sure) that the filter on textdata may be case sensitive as well. Looking for confirmation.




Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

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
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #806469
Posted Wednesday, October 21, 2009 9:13 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, October 29, 2009 11:09 AM
Points: 3, Visits: 7
Jack

Thanks.. you have single-handedly restored my faith in humanity...

I bashed this about a bit more and can add the following:

When trying to isolate individual queries (as I was trying to do), it is useful in the Events Selection tab, under Trace Properties, to deselect everything to just leave SQL:BatchStarting (under TSQL) and RPC:Completed (under Stored Procedures, if you are running a mix of inline queries and stored procs)

The make sure the textData checkbox is checked against each of these selections - I missed that on one of mine, and so it wont filter at all which made me think it was my filter syntax that wasn't working...

Then the following syntax will work in the Column Filters section (select textData and then click on the Like option - or Not Like)

%update table_get_stuff%
update table_get_stuff%

Both those work, don't put any quotes round the entire expression, and doesn't seem to be case sensitive (SQL 2005 Profiler)

%update table_get_stuff% %id = 35%

This will act, effectively, like an AND condition but needs exact syntax between the %%, else as Jack says %id%%=%%35% will take care of spaces

Hitting 'enter' after entering a condition above creates a new empty 'Like' box. Ignore it if you dont need it, otherwise enter another condition string and it will act as an OR condition.

Finally, I found filtering a bit 'flakey' - in that occasionally it stopped delivering some results and I needed to delete the conditions and re-enter them again to kick it back into life, though that didn't happen enough to be fully sure what was happening.

Thanks again
Post #806587
Posted Wednesday, October 21, 2009 9:26 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: 2 days ago @ 8:21 AM
Points: 10,907, Visits: 12,539
Mitch-723412 (10/21/2009)
Jack

Thanks.. you have single-handedly restored my faith in humanity...


Wow! That's a big compliment for just responding to a question on the forum for one of my articles.

Glad I could be helpful though.

Yup, any text filtering in Profiler is definitely flaky.

I'm going to be doing some research about case-sensitivity because when I ran a Trace with a textdata filter of %update table_name% and changed my update statement to start with a capital U I did not get any results. I did say that it looks like it MAY be case-sensitive. If it is, I will be blogging about it.




Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

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
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #806596
Posted Wednesday, October 21, 2009 9:49 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, October 29, 2009 11:09 AM
Points: 3, Visits: 7
Jack

I had a look at case sensitivity - what I have just found is that the filters aren't case sensitive - ie I found that %update% and %Update% worked (while the actual query syntax itself was update).

I also tried %UpDatE% and that worked ok.

What I did see, however, is that randomly (it seems) when I made a CHANGE to a condition (eg changed the u to a U) then it stopped filtering on that condition, giving the impression of being case sensitive.

Going back and changing it again seemed to kick it back into the loop, and it didn't always repeat, so if you're looking at it you need to go round the loop a lot to get the problem to appear.

At least that was my experience - I might be missing something!

Cheers
Post #806622
Posted Wednesday, October 21, 2009 10:04 AM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: 2 days ago @ 8:21 AM
Points: 10,907, Visits: 12,539
Mitch,

Thanks for your input. I'm just reporting what I saw. It shouldn't be case-sensitive. I need to get some different VM's up to test against. I was using Profiler 2008 against SQL Server 2005 sp2, but the Profiler version shouldn't matter because it is generating the same SQL Treace behind the scenes. Any testing I do probably won't happen for at least 3 weeks as I have the PASS Summit coming up and some more blog stuff scheduled ahead of it. It'll be interesting regardless of outcome.




Jack Corbett

Applications Developer

Don't let the good be the enemy of the best. -- Paul Fleming

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
How to Post Performance Problems
Crosstabs and Pivots or How to turn rows into columns Part 1
Crosstabs and Pivots or How to turn rows into columns Part 2
Post #806639
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse