Create trace to SQL table

  • I told somebody that it's no big deal creating some automation around performance tracing.... Then I went to look at sp_trace_create. I have only spent about a half hour so far looking around for scripts/articles.

    Does anybody know how to use the system procs to create traces that dump into a SQL database table?

    Not using the profiler GUI and not a trace file--I get how to do that already.

  • There is no direct way to do this. If you watch what Profiler does, it actually has the trace go to temporary files. You can find them under the local settings\temp folder for your user account. For instance, assuming the default path and a username of john:

    c:\documents and settings\john\local settings\temp

    Look for files named prf*.tmp. If you have a trace going, view the files with a text editor and you'll see at least one with the events in question.

    So basically they are logging to files and then importing the files into a trace table, but rapidly enough so it looks like it's directly writing to the table.

    K. Brian Kelley
    @kbriankelley

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply