Displays the last statement sent from a client to Microsoft® SQL Server™.
DBCC INPUTBUFFER (spid)
DBCC INPUTBUFFER returns this result set (the last event in the buffer was DBCC INPUTBUFFER(11)):
EventType Parameters EventInfo
-------------- ---------- ---------------------
Language Event 0 DBCC INPUTBUFFER (11)
(1 row(s) affected)
DBCC execution completed. If DBCC printed error messages, contact your system administrator.
This table provides more information about the columns returned in the result set.
Column name | Data type | Description |
---|---|---|
EventType | nvarchar(30) | Event type, for example: RPC, language, or event. |
Parameters | int | 0 = text 1- n = parameters |
EventInfo | nvarchar(255) | For EventType of RPC, EventInfo is the procedure name, and the parameters that fit are shown. For EventType of language or event and Parameters = 0, EventInfo is the first 255 characters of the event. |
DBCC INPUTBUFFER permissions default to members of the sysadmin fixed server role only, who can see any SPID. Other users can see any SPID they own. Permissions are not transferable.
This example assumes a valid system process ID of 10.
DBCC INPUTBUFFER (10)
sp_who | DBCC |
Trace Flags |