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
时间: 2024-10-11 06:10:50