Multiple choice technology databases

What is the command to get information about the currently running query for a particular process?

  1. sp_who2

  2. dbcc checkdb

  3. dbcc inputbuffer(spid)

  4. dbcc processinfo

Reveal answer Fill a bubble to check yourself
C Correct answer
Explanation

DBCC INPUTBUFFER(spid) is the command that displays the last statement sent from a client to SQL Server for a specific session/process ID (SPID). It shows what query is currently executing or was last executed. sp_who2 shows session info but not the actual query text, dbcc checkdb is for database integrity, and dbcc processinfo doesn't exist.