This project has moved. For the latest updates, please go here.
The following script is a simple example of how a .trc file can be opened using powerTrace and the Begin and End evnts can be displayed.

add-PSSnapin powerTrace

$traceEvents = get-sqltraceevent "c:\BigQuery.trc"

# Show Begin and End events
$traceEvents | Where {$_.eventClass -eq "Query Begin" -or $_.eventClass -eq "Query End"} |Format-Table EventClass, StartTime, CurrentTime, Duration, connectionid, SPID

Another example that is useful for performance tuning is to look at the total duration of all Query Subcube events.

add-PSSnapin powerTrace

$traceEvents = get-sqltraceevent "c:\BigQuery.trc"

$traceEvents | Where-Object {$_.eventClass -eq "Query subcube" } | measure-Object -Sum Duration

Last edited Oct 11, 2009 at 4:44 AM by dgosbell, version 1

Comments

No comments yet.