|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2005-01-06 : 08:26:44
|
| Pablo J. Rogina writes "While creating a trace file in SQL 2K, and setting several columns, I'm setting also column 4, with code like this:DECLARE @RC int, @TraceID int, @ON bit, @dbID intSET @ON = 1EXEC @RC = sp_trace_create @TraceID OUTPUT, 0, N'c:\Temp\t04_trace'SELECT 'RC'= @RC, 'TraceID'= @TraceID-- SQL:StmtCompleted Event, Text ColumnEXEC @RC = sp_trace_setevent @TraceID, 41, 1, @ON-- SQL:StmtCompleted Event, Database ID ColumnEXEC @RC = sp_trace_setevent @TraceID, 41, 3, @ON -- SQL:StmtCompleted Event, TransactionID ColumnEXEC @RC = sp_trace_setevent @TraceID, 41, 4, @ON-- SQL:StmtCompleted Event, NTUserName ColumnEXEC @RC = sp_trace_setevent @TraceID, 41, 6, @ON-- SQL:StmtCompleted Event, NTDomainName ColumnEXEC @RC = sp_trace_setevent @TraceID, 41, 7, @ONThe problem is that column 4 (TransactionID) is always NULL, no matter what I've tried (named transactions, implicits transactions, etc.). Even if I create a trace file in Profiler, TransactionID column gets no value other than NULL.I'd like to join the trace file with the Transaction Log and think I need this column.Is there anything I'm doing wrong?Thank you in advance.Pablo J. Rogina" |
|