Displays the last statement executed by user connection in SQL Server
Displays the last statement sent from a client to Microsoft® SQL Server™.
SyntaxDBCC INPUTBUFFER (spid)
Arguments
Spid : Is the system process ID (SPID) for the user connection as displayed in the output of the sp_who system stored procedure.