select loginname, loginsid, spid, hostname, applicationname, servername, databasename, objectname, e.category_id, cat.name, textdata, starttime, endtime, duration, eventclass, eventsubclass, e.name as EventName from ::fn_trace_gettable('C:Program FilesMicrosoft SQL ServerMSSQL.1MSSQLLOGlog.trc',0) inner join sys.trace_events e on eventclass = trace_event_id inner join sys.trace_categories as cat on e.category_id = cat.category_id where databasename = 'TraceDB' and e.category_id = 2 and --categroy 2表示database e.trace_event_id = 93 --93表示日志文件自动增长事件