In this article, I am explaining how to find which SQL queries are being run on an SQL Server.
Using the below query, we can get list the queries running on SQL Server
Using the below query, we can get list the queries running on SQL Server
SELECT
b.TEXT,
a.session_id,
a.status,
a.command,
a.cpu_time,
a.total_elapsed_time
FROM
sys.dm_exec_requests
a
CROSS
APPLY
sys.dm_exec_sql_text(sql_handle)
AS
b
- More info is available about sys.dm_exec_requests
- More info is available about sys.dm_exec_sql_text
KILL
session_id
No comments:
Post a Comment