Logger - MS SQL Server
Microsoft SQL Server
-
Open SQL Server Management Studio and connect to your database.
-
Create a new server-side trace:
DECLARE @TraceID INT; EXEC sp_trace_create @TraceID OUTPUT, 2, N'C:\Path\To\Your\LogFile.trc', 5, NULL; EXEC sp_trace_setevent @TraceID, 10, 1, 1; EXEC sp_trace_setevent @TraceID, 10, 2, 1; EXEC sp_trace_setevent @TraceID, 10, 3, 1; EXEC sp_trace_setevent @TraceID, 10, 4, 1; EXEC sp_trace_setevent @TraceID, 10, 12, 1; EXEC sp_trace_setstatus @TraceID, 1;
-
Stop and delete the trace when done:
EXEC sp_trace_setstatus @TraceID, 0; EXEC sp_trace_setstatus @TraceID, 2;