x
login about faq Site discussion (meta-askssc)

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 '10 at 05:09 AM in Default

Mandar Alawani gravatar image

Mandar Alawani
346 23 24 28

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

2 answers: sort voted first

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 '10 at 05:52 AM

Kev Riley gravatar image

Kev Riley ♦♦
46k 38 43 69

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 '10 at 10:21 AM Magnus Ahlkvist
(comments are locked)
10|1200 characters needed characters left

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

CREATE VIEW VerboseLog
AS
  SELECT tc.Name AS TraceCategory,
        te.Name AS TraceEvent,
        l.*
  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 '10 at 05:24 AM

ThomasRushton gravatar image

ThomasRushton ♦
29.2k 6 9 36

(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.

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x1834
x15

asked: Jun 24 '10 at 05:09 AM

Seen: 985 times

Last Updated: Jun 24 '10 at 05:09 AM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.