create table #tmpDBCCinputbuffer

I am trying to figure out what the hell this is.  It's running constanly when I view the activity monitor in SQL 2005 against a SQL 2000 db

create table #tmpDBCCinputbuffer ([Event Type] nvarchar(512), [Parameters] int, [Event Info] nvarchar(512))
insert into #tmpDBCCinputbuffer exec ('DBCC INPUTBUFFER(310)')
select [Event Info] from #tmpDBCCinputbuffer

is this something the system needs in SQL 2005 or SQL 2000?  When I try to kill the process it tells me I cannot kill my own process
LVL 1
dba123Asked:
Who is Participating?
 
Aneesh RetnakaranDatabase AdministratorCommented:
DBCC INPUTBUFFER, checks the input buffer for a particular system process ID (SPID).  The Enterprise Manager invokes it every time you select Current Activity, Process Info and double-click a particular process to see the most recent T-SQL commands this process submitted.
0
 
LowfatspreadCommented:
are you running the sql spy product?
0
 
ptjcbCommented:
I use fn_get_sql in 2005 to do the same thing. Until SQL Server 2000, sp3 you had to use DBCC INPUTBUFFER to see what code was executing. The limitation was that it could only display the first 255 characters, and only displays the first command executed. The new function, fn_get_sql() can be used to pinpoint which line of code is being currently executed The function will return info based on the sql_handle colum of master..sysprocesses. If the spid is not active when it is queried the handle will be 0 by default and you will not be able to return the inputbuffer. DBCC INPUTBUFFER returns the inputbuffer whether it is active or not.

0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.