question

champ avatar image
champ asked

executing time of a specified query

how can i get the executing time for some specefied query in sql server 2005
sql-server-2005sql
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Magnus Ahlkvist avatar image
Magnus Ahlkvist answered
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sorry i forgot but anyway thanx
0 Likes 0 ·
Håkan Winther avatar image
Håkan Winther answered
There are several ways to get the time -Profiler -set statistics time on -select * from sys.dm_exec_query_stats
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

champ avatar image
champ answered
SELECT sql_total_elapsed_time_s=convert(money,qs.total_elapsed_time)/1000000,text FROM sys.dm_exec_query_stats as qs CROSS APPLY sys.dm_exec_sql_text(sql_handle)
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.