例如:得到当前用户的query:
DECLARE @Handle binary(20)
SELECT @Handle = sql_handle FROM sys.sysprocesses WHERE spid = @@spid
SELECT * FROM ::fn_get_sql(@Handle)
go
例如:得到当前用户的query:
DECLARE @Handle binary(20)
SELECT @Handle = sql_handle FROM sys.sysprocesses WHERE spid = @@spid
SELECT * FROM ::fn_get_sql(@Handle)
go