SQL Script to Check Most Time Taking Queries at Instance Level

SELECT TOP(50) DB_NAME(t.[dbid]) AS [Database Name] 
	, REPLACE(REPLACE(LEFT(t.[text], 255), CHAR(10),''), CHAR(13),'') AS [Short Query Text]
	, qs.total_elapsed_time/qs.execution_count AS [Avg Elapsed Time]
	, qs.min_elapsed_time, qs.max_elapsed_time, qs.last_elapsed_time
	, qs.execution_count AS [Execution Count]
	, qs.total_logical_reads/qs.execution_count AS [Avg Logical Reads]
	, qs.total_physical_reads/qs.execution_count AS [Avg Physical Reads]
	, qs.total_worker_time/qs.execution_count AS [Avg Worker Time]
	, CASE WHEN CONVERT(nvarchar(max), qp.query_plan) LIKE N'%<MissingIndexes>%' THEN 1 ELSE 0 END AS [Has Missing Index]
	, qs.creation_time AS [Creation Time]
	--,t.[text] AS [Complete Query Text], qp.query_plan AS [Query Plan] -- uncomment to get query plan
FROM sys.dm_exec_query_stats AS qs WITH (NOLOCK)
CROSS APPLY sys.dm_exec_sql_text(plan_handle) AS t 
CROSS APPLY sys.dm_exec_query_plan(plan_handle) AS qp 
ORDER BY qs.total_elapsed_time/qs.execution_count DESC