Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 how to show time elapse of a query?

Author  Topic 

jeff06
Posting Yak Master

166 Posts

Posted - 2009-09-04 : 15:53:28
I am join to large tables. How can I record how long it takes for the program to run in program?
Thanks.
Jeff

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2009-09-05 : 02:52:39
declare @date datetime
set @date=getdate()

your_join_query

select datediff(second,@date,getdate())

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-09-05 : 06:30:51
you can also capture this information from profiler trace
Go to Top of Page
   

- Advertisement -