Wednesday, July 10, 2013

5 Query default trace

 

List trace category and event name

SELECT te.category_id,tc.name,te.trace_event_id,te.name FROM 
  sys.trace_events te,    sys.trace_categories tc
  WHERE te.category_id = tc.category_id

image

 

Query Default trace

 

SELECT   tc.name,te.name,ftg.DatabaseID,DB_NAME(ftg.databaseid),ftg.LoginName,ftg.HostName,ftg.ClientProcessID,ftg.spid,ftg.ApplicationName,ftg.StartTime,ftg.EndTime,
ftg.ObjectID,
ftg.ObjectName,ftg.ServerName,ftg.EventClass,ftg.Error,ftg.TextData
FROM   ::fn_trace_gettable(CONVERT(VARCHAR(150), ( SELECT TOP 1 f.[value] FROM sys.fn_trace_getinfo(NULL) f WHERE f.property = 2)), DEFAULT) AS ftg 
INNER   JOIN sys.trace_events AS te ON ftg.EventClass = te.trace_event_id  
INNER JOIN sys.trace_categories AS tc ON tc.category_id = te.category_id
ORDER BY   ftg.StartTime

 

image

 

SQL server trace: http://www.sqlpanda.com/2012/11/sql-server-trace.html

5 comments:

  1. Cartierbuy replica watches is the renowned French jeweller and watchmaker with replica cartier a history of pioneering design and a drive for excellence. The first references to Cartier wristwatches date back to 1888. Late in the 19th century it was pocket and chatelaine watches that were most popular, but Louis Cartier saw a future in timepieces that could be worn on the wrist.

    ReplyDelete
  2. Shop online for Moncler fake moncler jackets Clothing, Jackets & Coats fake moncler men jackets for Men and Women . Free Shipping & Free Returns for Loyallists or most Orders Over ...

    ReplyDelete
  3. Very excellent post!!! Thank you so much for your great content. Keep posting.....

    Big Data Training Institute in Pune
    Hadoop Training in Pune

    ReplyDelete

 

SQL Panda Copyright © 2011 - |- Template created by O Pregador - |- Powered by Blogger Templates