create table #tmpDBCCinputbuffer

Posted on 2006-05-19
Last Modified: 2012-08-13
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
Question by:dba123
    LVL 75

    Accepted Solution

    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.
    LVL 50

    Expert Comment

    are you running the sql spy product?
    LVL 27

    Assisted Solution

    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.


    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
    For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
    Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
    Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now