|
|
|
Demonstrates the new system function fn_trace_gettable to read a capture trace file & analyze it using SQL. |
Click here to copy the following block |
DECLARE @TraceCaptureFile nvarchar( 512 ); SET @TraceCaptureFile = 'C:\Documents and Settings\Umachandar Jayachand\' + 'My Documents\SQL Server Workspace\webpub capture.trc'
SELECT t.EventClass , LEFT( CAST( t.Textdata AS varchar( 8000 ) ) , 30 ) AS SQLStmtStart , LEFT( t.NTUserName , 25 ) AS NTUserName , t.Duration , t.CPU , t.Reads , t.Writes FROM ::fn_trace_gettable ( @TraceCaptureFile , DEFAULT ) AS t WHERE t.ApplicationName = 'xpweb70.dll';
SELECT t.EventClass , LEFT( CAST( t.Textdata AS varchar( 8000 ) ) , 30 ) AS SQLStmtStart , LEFT( t.NTUserName , 25 ) AS NTUserName , t.Duration , t.CPU , t.Reads , t.Writes FROM ::fn_trace_gettable( @TraceCaptureFile , DEFAULT ) AS t WHERE CAST( t.textdata AS nvarchar( 255 ) ) NOT LIKE N'DBCC FREEPROCCACHE%' And t.cpu > 10 and t.reads > 1000;
|
|
|
|
Submitted By :
Nayan Patel
(Member Since : 5/26/2004 12:23:06 PM)
|
|
|
Job Description :
He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting. |
View all (893) submissions by this author
(Birth Date : 7/14/1981 ) |
|
|