Groups | Blog | Home
all groups > sql server programming > august 2004 >

sql server programming : traceid



Victor Feng
8/26/2004 9:29:03 PM
To use sp_trace_setevent [ @traceid = ] trace_id, where can I get the trace_id?

Thanks
Victor
John Bell
8/26/2004 11:27:01 PM
Hi

The trace_id is returned as an output variable from sp_trace_create or from
running

Select * from ::fn_trace_getinfo(default)

There are examples of using these procedures in Kalen's Inside SQL Server
2000 ISBN 0-7356-0998-5

John

[quoted text, click to view]
Narayana Vyas Kondreddi
8/27/2004 7:21:07 AM
You will get a trace id when you create a trace using sp_trace_create.

Another way is to query the existing traces using fn_trace_getinfo.

You might find my following article useful:
http://vyaskn.tripod.com/server_side_tracing_in_sql_server.htm
--
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/


[quoted text, click to view]

pankaja NO[at]SPAM online.microsoft.com
8/28/2004 1:03:23 AM
Hello Victor

You may find it helpful (for learning purposes) to first create the trace
in Profiler and then script it out. This creates an almost functional SQL
script that you can open in SQL Query Analyzer. Just change the target
filename and you should be good to run the script and see how it works.

Thank you for using Microsoft newsgroups.

Sincerely

Pankaj Agarwal
Microsoft Corporation

This posting is provided AS IS with no warranties, and confers no rights.
AddThis Social Bookmark Button