SQL Start blackbox
Start blackbox
-- This script will create a procedure that defines and starts
-- a blackbox trace, and then marks the procedure to
-- start automatically every time SQL Server starts.
USE MASTER
GO
CREATE PROC blackbox
AS
declare @TraceID int
exec sp_trace_create @TraceID output, 8
exec sp_trace_setstatus @traceID, 1
RETURN
GO
EXEC sp_procoption blackbox, 'startup', 'on'
GO