Sunday, March 11, 2012

dbcc inputbuffer and long commands

We have some commands here that go over 2k characters, and I've seen
some elsewhere with text values that went over 64k, but dbcc
inputbuffer only seems to return 256 characters. Is there any way to
fetch longer commands?
Thanks.
Josh
On Tue, 07 Dec 2004 10:28:45 -0800, jxstern <jxstern@.nowhere.com>
wrote:
>We have some commands here that go over 2k characters, and I've seen
>some elsewhere with text values that went over 64k, but dbcc
>inputbuffer only seems to return 256 characters. Is there any way to
>fetch longer commands?
Aha, found:
http://support.microsoft.com/default...b;en-us;325607
FIX: The fn_get_sql Function Returns SQL Text for Handle in the
Sysprocesses System Table
But it doesn't seem to be very robust - seems not to find the command
in cache all the time.
At least the fn/hotfix is present on a SQL2K sp3a system, fwiw.
J.
|||jxstern wrote:
> We have some commands here that go over 2k characters, and I've seen
> some elsewhere with text values that went over 64k, but dbcc
> inputbuffer only seems to return 256 characters. Is there any way to
> fetch longer commands?
> Thanks.
> Josh
DBCC INPUTBUFFER returns an nvarchar(255)
You might be able to use fn_get_sql. See BOL for more info.
David Gugick
Imceda Software
www.imceda.com

No comments:

Post a Comment