DBCC INPUTBUFFER (T-SQL)

Displays the last statement sent from a client to Microsoft® SQL Server™.

Syntax

DBCC 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.
Result Sets

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.

Permissions

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.

Examples

This example assumes a valid system process ID of 10.

DBCC INPUTBUFFER (10)

See Also
sp_who DBCC
Trace Flags  

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.