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