Как посмотреть файл трассировки в самом sql

SELECT top 50 *
FROM fn_trace_gettable(N'\\\Backup\Trace_sql_serverov\ho_report\TracE20150822            000000.trc',DEFAULT)
where CONVERT(CHAR(8),StartTime,8) BETWEEN '09:00:00' and '23:00:00'
and not ApplicationName in ('NULL','Symantec Backup Exec™ for Windows Servers')
AND ApplicationName NOT LIKE  ('SQLAgent - TSQL%')
AND ApplicationName NOT LIKE  ('DatabaseMail%')
AND textdata not LIKE  ('RESTORE%')
ORDER BY duration  DESC

FROM fn_trace_gettable(N'C:\TraceFiles\LongRunningQueries.trc',DEFAULT);


Similar Posts:

Добавить комментарий