/* * audit trace files */ -- list of configured traces select * from sys.traces -- disable trace (ALTER TRACE privs is required) -- @arg TRACE_ID -- @arg 0 - disable, 1 -enable exec sp_trace_setstatus 1,0 -- audit instance parameters -- default auditing select * from sys.configurations where name like '%trace%'; -- static, advanced option -- c2 mode auditing select * from sys.configurations where name like '%audit%'; -- dynamic -- disable audit c2 mode -- -- enable advanced options sp_configure 'show advanced options', 1 ; GO -- load dynamic parameters RECONFIGURE ; GO -- disable audit c2 sp_configure 'c2 audit mode', 0; GO RECONFIGURE ; GO -- "GO" senf statements in the buffer to sqlserver (oh God)