dbTalk Databases Forums  

DBCC INPUTBUFFER results into table

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss DBCC INPUTBUFFER results into table in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tom
 
Posts: n/a

Default DBCC INPUTBUFFER results into table - 05-09-2007 , 06:04 PM






Does anyone know if there is a simple way to get the results of a DBCC
INPUTBUFFER() request into a table? I have a process for monitoring
activity that will give me the results of sp_who2 into a temp table,
and want to scroll through the active connections and get the input
buffers into another table for review:

Insert into #TmpWho
exec sp_who2 'active'

Something like that with the dbcc command.

I am using SQL 2000 SP4.

Thanks,

Tom


Reply With Quote
  #2  
Old   
tomas.zalesak
 
Posts: n/a

Default Re: DBCC INPUTBUFFER results into table - 05-10-2007 , 07:52 AM






Quote:
Does anyone know if there is a simple way to get the results of a DBCC
INPUTBUFFER() request into a table? I have a process for monitoring
activity that will give me the results of sp_who2 into a temp table,
and want to scroll through the active connections and get the input
buffers into another table for review:
Insert into #TmpWho exec sp_who2 'active'
CREATE TABLE #Inputbuffer(
EventType NVARCHAR(30) NULL,
Parameters INT NULL,
EventInfo NVARCHAR(255) NULL
)
GO

INSERT #Inputbuffer
EXEC('DBCC INPUTBUFFER(<YourSpid>)')
GO

SELECT * FROM #Inputbuffer

--
Tom
http://kbupdate.info/ | http://suppline.com/



Reply With Quote
  #3  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: DBCC INPUTBUFFER results into table - 05-10-2007 , 05:21 PM



tomas.zalesak (tomas.zalesak (AT) gmail (DOT) com) writes:
Quote:
CREATE TABLE #Inputbuffer(
EventType NVARCHAR(30) NULL,
Parameters INT NULL,
EventInfo NVARCHAR(255) NULL
)
GO

INSERT #Inputbuffer
EXEC('DBCC INPUTBUFFER(<YourSpid>)')
GO

SELECT * FROM #Inputbuffer
Adding WITH NO_INFOMSGS to the DBCC command makes it less noisy.


--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
  #4  
Old   
Tom
 
Posts: n/a

Default Re: DBCC INPUTBUFFER results into table - 05-11-2007 , 05:18 PM



Incredibly easy, thanks so much for the help!

<SNIPPED>

- Tom
"When I was a boy of 14, my father was so ignorant I could hardly
stand to have the old man around. But when I got to be 21, I was
astonished at how much the old man had learned in seven years." - Mark
Twain


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.