Map SQL Server Profiler EventClass ID to its name in a saved trace table

本文介绍如何将 SQL Server Profiler 中保存到表的跟踪记录中的 EventClass ID 映射回其描述。通过使用 sys.trace_events 目录视图,可以轻松地将 ID 转换为有意义的名称,方便进一步分析。
Map SQL Server Profiler EventClass ID to its name in a saved trace table

If you've ever worked with SQL Server profiler then you're familiar with the EventClass column in the trace.

It tells you what event is being monitored for each row. When you save this trace to a table you can see

that the EventClass no longer has a description but an ID. So how do you map this to a description?

If you know where to look it's amazingly simple but if you don't here's a hint: sys.trace_events

Here's a script to help you out:

SELECT   TE.name, T.*
FROM     dbo.Trace T -- table that contains the trace results
         JOIN sys.trace_events TE ON T.EventClass = TE.trace_event_id
ORDER BY RowNumber
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值