Thursday, April 12, 2012

SQL Server Default Trace


To check the default trace is enabled or not:
SELECT * FROM sys.configurations WHERE configuration_id = 1568

If not enabled then execute the following code to enable:
sp_configure 'show advanced options', 1;
GO
RECONFIGURE;
GO
sp_configure 'default trace enabled', 1;
GO
RECONFIGURE;
GO

To find the path of trace file:
SELECT * FROM ::fn_trace_getinfo(0)

No comments:

Post a Comment