We can find out all the waiting tasks or blocked session in SQL server through below script. SELECT blocking.session_id
Continue readingTag: Long running Queries in SQL SERVER
How to find longest running query In Sql Server
SELECT DISTINCT TOP 3 t.TEXT QueryName, s.execution_count AS ExecutionCount, s.max_elapsed_time AS MaxElapsedTime, –ISNULL(s.total_elapsed_time / s.execution_count, 0) AS AvgElapsedTime, s.creation_time
Continue reading