Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Query Execution Time Expand / Collapse
Author
Message
Posted Sunday, March 16, 2008 1:21 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, November 25, 2009 4:57 PM
Points: 74, Visits: 550
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
Post #469962
Posted Sunday, March 16, 2008 6:47 AM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Today @ 12:11 PM
Points: 42,469, Visits: 35,541
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 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #469981
Posted Sunday, March 16, 2008 8:02 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, November 25, 2009 4:57 PM
Points: 74, Visits: 550
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
Post #469993
Posted Sunday, March 16, 2008 12:06 PM


SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: General Forum Members
Last Login: Thursday, June 5, 2014 10:54 AM
Points: 9,902, Visits: 9,480
I think that you want the events SQL:BatchCompleted and RPC:completed.

and then make sure that StartTime and EndTime columns as selected.


-- RBarryYoung, (302)375-0451 blog: MovingSQL.com, Twitter: @RBarryYoung
Proactive Performance Solutions, Inc.
"Performance is our middle name."
Post #470012
Posted Sunday, March 16, 2008 9:35 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 11:50 AM
Points: 36,779, Visits: 31,235
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
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #470058
Posted Thursday, March 20, 2008 4:01 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Tuesday, August 23, 2011 12:00 PM
Points: 48, Visits: 215
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
Post #472618
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse