T-SQL生成SQL追踪信息

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

declare @maxfilesize bigint;
declare @filecnt int;
set @trid = 0;
set @maxfilesize = 10;
set @filecnt = 10;
exec sp_trace_create @trid OUTPUT, 2, N'd:\sqltrace\mytrace', @maxfilesize, NULL, @filecnt;
select @trid;
go