(Related to this question)
If I want to see if there are currently any long-running queries executing on my database, what's the easiest way of checking? (I expect the answer will be some query on
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It only takes a minute to sign up.Sign up to join this community
WhoIsActive from Adam Machanic is an excellent tool/sp to see what's currently happening on your server.
The below tutorial from Brent Ozar shows how to periodically log sp_whoisactive to a table for later analysis.
I use the following query to get information about currently running queries. It has the advantage of not requiring any additional packages or addons:
SELECT * FROM sys.dm_exec_requests CROSS APPLY sys.dm_exec_sql_text(sql_handle)
You would probably be most interested in the [start_time], [total_elapsed_time], and [text] fields.