November 5, 2009 at 3:41 pm
Profiler version 2008 running against a 2005 SQL Server box.
I'm not sure on how best to word this so apolagies if this seems verbose.
Currently in Profiler whgen capturing amy SELECT/INSERT/UPDATE/DELETE command I get the sam T-SQL command at least 4 times. Stmnt:Starting/Stmnt:Completed and then the Batch equiivelants. I can narrow this down by dropping the Batch items and while I could further reduce this by keeping just the STmnt:Completed event, I like to include the Stmnt:Starting event because if there is some long running execution, I can see the actual T-SQL ebing executed where as with Stmnt:Completed you see the T-SQl code only after it's completion.
My thinking is there shoudl be a way so that when tracing the STmnt event, you get just 1 line that shows as soon as the command starts and when the command is done, instead of getting another event line, some value in the event line you alrady have simply changes to indicate the status has changed. Make sense>
So if I am tracing the activity and a long running SELECT starts I see that SELECT in my trace and it shows with a status of Stmn:Starting and then once it's done the status is chnaged to Stmnt:Completed and no additional copy or event for that same T-SQL is shown.
It juist takes a long time dig thru what often feels like a lot of excess capturing.
Make ssense? Anyone have any tiops on how to do this or at least to minimize the logging while still maintining the status of the event?
Thanks
Kindest Regards,
Just say No to Facebook!November 5, 2009 at 8:37 pm
It would be nice but, nope... you're pretty much stuck with a start and end record.
--Jeff Moden
Change is inevitable... Change for the better is not.
November 17, 2009 at 1:13 pm
Jeff Moden (11/5/2009)
It would be nice but, nope... you're pretty much stuck with a start and end record.
Thanks Jeff, I figured as much.
Let me ask you this, If i wanted to run a Trace where each T-SQL Command was listed only once and I didn;t care about recording thet start and stoop(or complete) portions of the comands; I just want to get 1 line for each time T-SQL statement is run, is there any single Event in Profiler I can trace that will ensure I catch everything whether it is something that executes within a STored procedure or UDF or just a straight up SQL statement?
I'm tracing the activities of our accounting app and I want to trace & capture every SELECT/UPDATE/INSERT/DELETE it executes whether that is within a Stored Procedure, a UDF or just a plain old T-SQL command. I'm no Profiler gurur but I think I recall reading somehwere that for comamnds execuetd within an Stored Procedure you have to use a diffierent event then for regular SQL statements.
Thanks
Kindest Regards,
Just say No to Facebook!Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply