Re: Viewing the current statement for an SPID
From: Hari Prasad (hari_prasad_k_at_hotmail.com)
Date: 07/08/04
- Next message: Bradley M. Small: "Re: SQL Server 2005 Express Beta messes up your SQL Server 2000, BEWARE"
- Previous message: CJM: "Re: Error 22022: Problems with email"
- In reply to: Strider: "Viewing the current statement for an SPID"
- Next in thread: Strider: "Re: Viewing the current statement for an SPID"
- Reply: Strider: "Re: Viewing the current statement for an SPID"
- Messages sorted by: [ date ] [ thread ]
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;
- Next message: Bradley M. Small: "Re: SQL Server 2005 Express Beta messes up your SQL Server 2000, BEWARE"
- Previous message: CJM: "Re: Error 22022: Problems with email"
- In reply to: Strider: "Viewing the current statement for an SPID"
- Next in thread: Strider: "Re: Viewing the current statement for an SPID"
- Reply: Strider: "Re: Viewing the current statement for an SPID"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
Loading