Sunday, March 11, 2012

Dbcc Inputbuffer

Hi folks.
DBCC INPUTBUFFER(79)
the statement returned is too short, not full. Can i get full STATEMENT that is sent by the user.
Howdy!If you are using sp3a see "What's New" in the release notes. Otherwise, no.

-PatP|||Hi Pat, thanx.
select serverproperty('productlevel')
returns SP3.
There are BOOKSONLINE in the programs group only. Where to find the release notes.

Howdy!|||There is a new function in SP3 called fn_get_sql.

Here is an article:

http://www.novicksoftware.com/UDFofWeek/Vol1/T-SQL-UDF-Volume-1-Number-14-fn_get_sql.htm

HTH,
Roby2222|||If you check the release notes for sp3a (http://www.microsoft.com/sql/downloads/2000/sp3.asp?SD=gn&LN=en-us&gssnb=1), you'll find a reference to fn_get_sql (http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_fa-fz_3nqa.asp) that ought to solve your problem.

-PatP|||Thanx all.
But there's a problem.
i can get the STATEMENT only for SPIDs that r currently running. Not for those which have status SLEEPING.
DBCC INPUTBUFFER returns the last statment for SLEEPING connections but ::fn_get_sql doesn't.

eg. if i open QA , execute STATEMENT and don't disconnect, i can get the text from DBCCINPUTBUFFER but not from the function.

Howdy!

No comments:

Post a Comment