Thread: SQL Server 2005
View Single Post
  #38 (permalink)  
Old 11-14-2007, 02:33 AM
kingmaker kingmaker is offline
D-Web Genius
 
Join Date: Jun 2007
Posts: 882
kingmaker is on a distinguished road
Send a message via Yahoo to kingmaker
Default Dbcc Inputbuffer / Outputbuffer

DBCC INPUTBUFFER / OUTPUTBUFFER

Display the last statement sent from a client to a database instance.

Syntax
DBCC INPUTBUFFER (session_id [, request_id ])
[WITH NO_INFOMSGS ]

DBCC OUTPUTBUFFER (session_id [, request_id ])
[WITH NO_INFOMSGS ]

Key:
session_id - The session ID
request_id - A specific request (batch) within the session.
NO_INFOMSGS - Suppress all information messages (severity 0-10)

To find the request_ids for a given session id (@@spid = current session):

SELECT request_id
FROM sys.dm_exec_requests
WHERE session_id = @@spid

Example

-- Display session # 52
DBCC INPUTBUFFER (52);
DBCC OUTPUTBUFFER (52);
__________________
The KINGMAKER
Makes Every Thing Possible

Stuffs (My Blog)
Reply With Quote