May 10, 2011 at 11:04 am
I want to run a trace on schedule. can any one tell me how to script a SQL Server profiler trace? So that i can put it in a scheduled job.
Thanks in advance.
May 10, 2011 at 11:20 am
Start with sp_trace_create. Check that on MSDN, and it'll refer you to sp_trace_setevent, fn_trace_getinfo, and all the rest.
- Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
Property of The Thread
"Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon
May 10, 2011 at 11:28 am
Open the profiler GUI, set up the trace you want (against a dev server). Run. Stop. File -> Export -> Script trace definition.
Open the resultant file in Management Studio and edit as necessary.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
May 10, 2011 at 11:34 am
Thank you very much Guys......... It helps me a lot.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply