Event class description not showing

Hi All,

When I save data from SQL Server trace file to a SQL table, the EventClass column shows ID and not description. I mean, EventClass column for SQL:BatchCompleted shows 12 and not original description.

Can this be changed??

more ▼

asked Jun 24, 2010 at 05:09 AM in Default

Mandar Alawani gravatar image

Mandar Alawani
376 33 39 44

(comments are locked)
10|1200 characters needed characters left

2 answers: sort newest

Quick and dirty way to deal with this is to create a view, similar to:

  SELECT tc.Name AS TraceCategory,
        te.Name AS TraceEvent,
  FROM   **TraceTableName** l
        LEFT JOIN sys.trace_events te
          ON l.EventClass = te.trace_event_id
        LEFT JOIN sys.trace_categories tc
          ON te.category_id = tc.category_id;
Of course, you may want to trim the columns down a bit...
more ▼

answered Jul 27, 2010 at 05:24 AM

ThomasRushton gravatar image

ThomasRushton ♦
34.2k 18 20 44

(comments are locked)
10|1200 characters needed characters left

The Event IDs and descriptions are found in sys.trace_events

One option could be to join to this catalog view when querying the trace data.

When using the Profiler UI, the translation is made for you - not sure you can make the trace store the actual descriptions.

more ▼

answered Jun 24, 2010 at 05:52 AM

Kev Riley gravatar image

Kev Riley ♦♦
54.1k 47 49 76

I'd say it wouldn't be advisable to include the descriptions in the capture even if it was doable. Event descriptions might change over time (Service packs etc). We use DB:s to normalise data, then I think it should be kept normalised if possible.
Jun 24, 2010 at 10:21 AM Magnus Ahlkvist
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.



asked: Jun 24, 2010 at 05:09 AM

Seen: 1502 times

Last Updated: Jun 24, 2010 at 05:09 AM