I'am running this and getting an error. Help appreciated
DECLARE @trace_ID int , @path_file nvarchar(200)
--SELECT @path_file=output_path_file FROM table WHERE tid = 1
--SELECT @trace_ID = traceid
--FROM ::fn_trace_getinfo(0)
--WHERE property = 2
--AND value = @path_file
EXEC sp_trace_setstatus @trace_ID,0--<< stop ---- I believe the error is here
EXEC sp_trace_setstatus @trace_ID,2--<< Close
Msg 214, Level 16, State 5, Procedure sp_trace_setstatus, Line 1
Procedure expects parameter '@traceid' of type 'int'
I tried this also
EXEC sp_trace_setstatus '@trace_ID + CAST(varchar,id) + ', 0
EXEC sp_trace_setstatus '@trace_ID + CAST(varchar,id) + ', 2
Thanks in advance