March 16, 2008 at 1:21 am
Hi Friends,
I am Execution Some big query In Mangement Studio it will showing around 7min time.
But my clinet is asking what time its execution is starting and Ending time
Know i want Query Execution TIME and Ending Time
what is the best why to find out Time
Best Regasrds
ms
March 16, 2008 at 6:47 am
You can use SQL Profiler. Trace the event T-SQL Batch completed and take the start time, end time and duration columns. Duration is in microseconds.
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
March 16, 2008 at 8:02 am
Hi Friend Thanku for response
i am using SQL profiler but where it is exactly iam not understanding could plz tel me the step wise plz
T&R
ms
March 16, 2008 at 12:06 pm
I think that you want the events SQL:BatchCompleted and RPC:completed.
and then make sure that StartTime and EndTime columns as selected.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
March 16, 2008 at 9:35 pm
DECLARE @EndTime DATETIME
DECLARE @StartTime DATETIME
SET @StartTime = GETDATE()
--... code here to be measured for duration
SET @EndTime = GETDATE()
PRINT 'StartTime = ' + CONVERT(VARCHAR(30),@StartTime,121)
PRINT ' EndTime = ' + CONVERT(VARCHAR(30),@EndTime,121)
PRINT ' Duration = ' + CONVERT(VARCHAR(30),@EndTime,114) + '(hh:mi:ss:mmm)'
If that doesn't do it, then try SET STATISTICS TIME ON
--Jeff Moden
Change is inevitable... Change for the better is not.
March 20, 2008 at 4:01 pm
Once you have identified the slow running query, you could also utilize the Include Client Statistics button located next to the Include Actual Query Plan in the SSMS(SQL Server Management Studio). Execute the query couple of times and you will be able to get an average execution time for your query
Hope this helps
Vinoj
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply