开发者

Extract Transact-SQL Event from tracefile using C#

I have to play number of trace files created in SQL Server 2005 against 2008 and compare result of each statement. It is one of the proposed ways that migration went fine

In SQL Profiler menu I can go

File/Export/Extract SQL Server Events/Extract Transact-SQL Events

It creates nice script file where all T-SQL statements divided with GO I would like to get same result through the code since I have to process about 140 trace files 50MB each and number of them can vary.

If I export trace file into TraceTable for each S开发者_StackOverflowP I have about four records

RPC:Starting

SP:Starting

SP:Completed

RPC:Completed

In situation above extract produce just two lines

Exec some_sp
GO

I know how to read tracefile using SMO but again I have to create pretty sophisticated logic to properly pair and aggregate all Start/Complete events and not miss anything.

Does anybody knows hot to achieve extract T-SQL events using SMO and C# and delegate analysis of tracefile to SMO and/or Profiler API?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜