dbTalk Databases Forums  

Running Profiler via a SQL script.

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Running Profiler via a SQL script. in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Jimbo
 
Posts: n/a

Default Running Profiler via a SQL script. - 11-06-2009 , 09:42 AM






Hi,

SQL 2005 Enterprise Edition (SP2)

I'm having trouble running a SQL script generated via the SQL 2005
Profiler.

I've set up a very simple proifle template to look for 'Crystal
Report' SQL that runs for over 2 seconds in the mill - the only two
filters I have on the template are 'Application name' and 'Duration'.
When I run it in the Profile GUI, all is fine, and I receive the
expect output.

When I generate a SQL script of the profile template, to run in Query
Analyser or as a scheduled job, none of the filtering seems to work,
and I receive data for all SQL running through the mill.

What's wrong? Does anyone have any suggestions?


Thanks very much,

James.

Reply With Quote
  #2  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Running Profiler via a SQL script. - 11-06-2009 , 05:38 PM






Jimbo (james.goodwill (AT) googlemail (DOT) com) writes:
Quote:
SQL 2005 Enterprise Edition (SP2)

I'm having trouble running a SQL script generated via the SQL 2005
Profiler.

I've set up a very simple proifle template to look for 'Crystal
Report' SQL that runs for over 2 seconds in the mill - the only two
filters I have on the template are 'Application name' and 'Duration'.
When I run it in the Profile GUI, all is fine, and I receive the
expect output.

When I generate a SQL script of the profile template, to run in Query
Analyser or as a scheduled job, none of the filtering seems to work,
and I receive data for all SQL running through the mill.

What's wrong? Does anyone have any suggestions?
There was a bug with creating the script in Profiler, so that traces were
not exported correctly. I don't remember when it was fixed, but take a
look at the calls to sp_trace_setfilter at the end of the script, and
verify the calls against the documentation in Books Online.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx

Reply With Quote
  #3  
Old   
Jimbo
 
Posts: n/a

Default Re: Running Profiler via a SQL script. - 11-08-2009 , 12:49 PM



On Nov 6, 11:38*pm, Erland Sommarskog <esq... (AT) sommarskog (DOT) se> wrote:
Quote:
Jimbo (james.goodw... (AT) googlemail (DOT) com) writes:
SQL 2005 Enterprise Edition (SP2)

I'm having trouble running a SQL script generated via the SQL 2005
Profiler.

I've set up a very simple proifle template to look for 'Crystal
Report' SQL that runs for over 2 seconds in the mill - the only two
filters I have on the template are 'Application name' and 'Duration'.
When I run it in the Profile GUI, all is fine, and I receive the
expect output.

When I generate a SQL script of the profile template, to run in Query
Analyser or as a scheduled job, none of the filtering seems to work,
and I receive data for all SQL running through the mill.

What's wrong? Does anyone have any suggestions?

There was a bug with creating the script in Profiler, so that traces were
not exported correctly. I don't remember when it was fixed, but take a
look at the calls to sp_trace_setfilter at the end of the script, and
verify the calls against the documentation in Books Online.

--
Erland Sommarskog, SQL Server MVP, esq... (AT) sommarskog (DOT) se

Links for SQL Server Books Online:
SQL 2008:http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005:http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000:http://www.microsoft.com/sql/prodinf...ons/books.mspx
Erland,

Thank you. I have created scripted profiler SQL myself without using
the Profiler to create it for me, so I will have a look at the SQL
created.

Thanks once again.

James.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.