Trace event not logging information | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Trace event not logging information

I created an Trace Event and set the event to get SQL::batchcompleted related log.
Then I changed the status of event to start mode.
I have used sp_trace_create, sp_trace_setevent, sp_trace_setstatus events to do these tasks. After doing this I entered some queries to create and drop some tables.
These information is not getting populated in the log (.trc) files.
This is the code I have used in query analyser to generate log. Create a trace which logs the information in satishlog.trc 1)DECLARE @TraceIdOut int exec sp_trace_create @traceid= @TraceIdOut OUTPUT
,@options = 2 ,@tracefile =N’c:satishlog’ PRINT @TraceIdOut
2)Description :After the first statment is executed ,it returns the TraceId. This traceid must be used in the second command to set the traceid field .
DECLARE @On bit SET @On = 1 exec sp_trace_setevent @traceid = 1,@eventid = 12,@columnid =1 , @on = @On 3)use the trace id returned from command 1 instead of value 1 in the below command. EXEC sp_trace_setstatus @traceid = 1
, @status = 1
I can provide you with more information regarding this.
I don’t know straight solution, but previously during the same issue I have just restarted SQL server services and get to work the trace procedure with TSQL. You may try the same if possible, as a test try using PROFILER too during same time. Satya SKJ
Contributing Editor & Forums Moderator
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
I installed a copy of SQl Server 2005 and the trace is working absolutely fine.
Thanks for your help