SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Process profiler log in C#


Process profiler log in C#

Author
Message
sqlrand
sqlrand
Grasshopper
Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)Grasshopper (19 reputation)

Group: General Forum Members
Points: 19 Visits: 105
I am in charge of migration DB from 2k5 to 2k8
One of tests to check that all functionality works same way in 2k8 as in 2k5 is “playing” trace file log on 2k5 and 2k8 in parallel and compare result for each statement as well as end result of database.
Because DB in heavy usage for period of 8 hours it generates about 140 files 50MB each. I would like to write some code which will do same what profiler does when you open trace file set some filter like DatabaseId and then using menu
File/Export/Extract SQL Server Events/Extract Transact-SQL Events
to get script file.
In my research I only found only articles how to read trace file using Microsoft.Sqlserver.Managment,Trace.TraceFile object. But in this case I have to also build logic which will figure one line out approximately four in trace file
E.g. simple call for SP creates four events
- RPC Started
-SP Started
-SP completed
-RPC completed
If any other events happened in between of those four you have process them accordingly and create separate statement in script.
SQL Profiler when extracts Transact-SQL Event does all job on it is own. I would appreciate if somebody points me how I can achieve same from code (I need process a lot of trace file) using posible kow figured method of TraceFile or something esle

Alternatively I can put tarce file into table using fn_trace_gettable but again will have to figure how query table to generate SQL script

Thanks!

Thanks!
SQLALX
SQLALX
SSC Rookie
SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)SSC Rookie (48 reputation)

Group: General Forum Members
Points: 48 Visits: 83
If your task is to replay SQL trace file, you can use the following tool.

Replay SQL Trace tool


This tool replays SQL profiler trace file against loca/remote SQL server
and give you replay result file, just like Profiler.
Since this is console mode application, you can create a batch file to run multiple SQL trace files.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search