How to dump an output from SQL Server Profiler 2008 to a CSV-like file

If you save it into a trace table; you can get the data in a table in SQL Server which will let you manipulate it to your hearts content; including dumping it out to CSV if still required. The text data column is fully represented in the table.


If you choose SaveTrace Table. You will be prompted for the name of the table and the database. Lets say you call it ProfilerTemp in the database scratch.

Enter those; you can query the table using

select * from scratch.dbo.ProfilerTemp

You will see everything in the trace window in the table. If you didnt filter down to just stored procedures and want just them in the select

Select textdata from [Scratch].[dbo].[ProfilerTemp] 
  where eventclass = 10 
  And textdata like 'exec %' 
  and not cast(TextData as nvarchar(max))= 'exec sp_reset_connection'

This filters out non procedure calls and any connection resets you may have. You may need to add more filters depending on what you are trying to do.

If you want this out as a text file; choose query – results to file and run the query. This will prompt for the file name and give you the parameter text as a text file.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)