Before you create these views, you must import the trace file into a SQL Server 2000 table named ActivityTrace. The script for a stored procedure, trace_gettable, imports the data from the trace file to a SQL Server 2000 table.
For additional information, click the following article number to view the article in the Microsoft Knowledge Base:

View v_difference

CREATE view v_difference as
select top 100 percent
substring(TextData, 1,40) as [object_name]
,substring(TextData, 41,40) as [counter_name]
,substring(TextData,81,35) as [instance_name]
,max(cast(substring(TextData,116,11) as int)) as [maximum]
,min(cast(substring(TextData,116,11) as int)) as [minimum]
,max(cast(substring(TextData,116,11) as int))
-min(cast(substring(TextData,116,11) as int)) as [difference]
,count(*) as [count]
,datediff(mi,min(StartTime),max(StartTime)) as [minutes]
from ActivityTrace
where EventClass = 83
group by
substring(TextData, 1,40)
,substring(TextData, 41,40)
,substring(TextData,81,35)
having max(cast(substring(TextData,116,11) as int))
-min(cast(substring(TextData,116,11) as int)) > 0
order by [difference] desc

View v_Access_methods

CREATE view v_Access_methods as
select top 100 percent
substring(TextData,41,40) as [counter name]
,left(starttime,20) as [time]
,cast(substring(TextData,116,11) as int) as [counter value]
from ActivityTrace
where substring(TextData,1,40) like '%:Access Methods%'
order by substring(TextData,41,40), starttime

View v_object_names

create view v_object_names as
select top 100 percent
substring(TextData,charindex(':',TextData),25) as [object_name]
from ActivityTrace
where EventClass = 83
group by
substring(TextData,charindex(':',TextData),25)
order by [object_name]