declare @spid int;
declare @sql_handle binary(20);
set @spid = 437
SELECT @sql_handle = sql_handle
FROM sysprocesses As A with (nolock)
where spid = @spid
select text
from ::fn_get_sql(@sql_handle)
SQlserver 2000 根据spid 查询执行的SQL,布布扣,bubuko.com
SQlserver 2000 根据spid 查询执行的SQL
原文:http://www.cnblogs.com/driftsky/p/3885017.html