Consider using sp_whoisactive. This will show active queries along with resource utilization.
Azure sql database check current active running session and query
sakuraime
2,321
Reputation points
I would like to have a query to check in Azure sql database, where I can see the current running active query from which spid , user ,host,ip program . Any one has the idea ?
2 answers
Sort by: Newest
-
-
Anurag Sharma 17,571 Reputation points
2021-04-09T12:36:49.817+00:00 Hi @sakuraime , welcome to Microsoft QnA forum.
You can run below query to get all the required information:
select r.session_id, s.login_name, c.client_net_address, s.host_name, s.program_name, st.text, s.status from sys.dm_exec_requests r inner join sys.dm_exec_sessions s on r.session_id = s.session_id left join sys.dm_exec_connections c on r.session_id = c.session_id outer apply sys.dm_exec_sql_text(r.sql_handle) st where client_net_address is not null and text is not null and s.status = 'running'
Reference Article: Get username and/or IP address responsible for a query
Please let us know if this helps.
----------
If answer helps, please mark it as 'Accept Answer'