Sometimes, when you cannot pin down what is causing something to run slowly because F12 says it's still waiting for a response from the server, it's a process running in SQL that is taking a long time.
You can run the script below on a SQL Server in order to see what SQL processes are running and determine where the issue may lie in SQL:
SELECT sqltext.TEXT,
req.session_id,
req.status,
req.command,
req.cpu_time,
req.total_elapsed_time
FROM sys.dm_exec_requests req
CROSS APPLY sys.dm_exec_sql_text(sql_handle) AS sqltext
The results will contain one line per SQL script running, including the one above, so it will always have at least one result. The SQL queries will be shown as running or suspended with suspended ones waiting for the running ones to complete.
Comments
0 comments
Please sign in to leave a comment.