View a list of current requests

On my test server, a large request is executed (which is good), but this is a multi-line request. For instance. in SSMS, I told him to run something like:

begin transaction;
query;
query;
query;
query;
commit;

I want to see what query is running on the list. Selecting textfrom sys.dm_exec_sql_textreturns the entire statement, not the specific command executed in the list. Is there a way to view the individual commands that are being processed?

In case it matters (sometimes it happens), it runs on an instance of SQL Azure.

+4
source share
2 answers

Use DBCC INPUTBUFFER

DBCC INPUTBUFFER(your session id)

It will display the request running in your session

+3
source

Source: https://habr.com/ru/post/1666021/


All Articles