执行sql 时间

SELECT TOP 10 --eq.*,
total_worker_time/execution_count AS Avg_CPU_Time
,execution_count
,total_elapsed_time/execution_count as AVG_Run_Time,creation_time ,last_execution_time,last_elapsed_time/1000
,(SELECT
SUBSTRING(text,statement_start_offset/2,(CASE
WHEN statement_end_offset = -1 THEN LEN(CONVERT(nvarchar(max), text)) * 2 
ELSE statement_end_offset 
END -statement_start_offset)/2
) FROM sys.dm_exec_sql_text(sql_handle)
) AS query_text 
FROM sys.dm_exec_query_stats eq where creation_time > '2017-06-09 04:41:17.307'
ORDER BY Avg_CPU_Time DESC

  https://stackoverflow.com/questions/36056475/azure-sql-frequent-connection-timeouts

原文地址:https://www.cnblogs.com/fcq121/p/6971535.html