Re: Viewing the current statement for an SPID

From: Hari Prasad (hari_prasad_k_at_hotmail.com)
Date: 07/08/04


Date: Thu, 8 Jul 2004 16:41:16 +0530

Hi,

For all versions execute:-
----------------------------

dbcc inputbuffer(spid) -- Will display only first 255 charecters of TSQL

For SQL 2000 sp3a and higher -- WIll show all the characters of TSQL
-------------------------------------
fn_get_sql

eg:

DECLARE @Handle binary(20)
SELECT @Handle = sql_handle FROM sysprocesses WHERE spid = 52
SELECT * FROM ::fn_get_sql(@Handle)

--
Thanks
Hari
MCDBA
"Strider" <Strider@discussions.microsoft.com> wrote in message
news:D5E70F61-BE8A-43A5-AC29-A535DF827543@microsoft.com...
> Is it possible to view the current statement an SPID is executing;


Relevant Pages


Loading