fn_getsql function | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

fn_getsql function

Hello, Why I don’t get any resultset, when I execute the following SQL Statements. SPID is valid. Thanks in advance. declare @handle binary(20)
select @handle = sql_handle
from master.dbo.sysprocesses where spid = 84
select * from ::fn_get_sql(@handle)

It has to be an active (runnable) process for ::fn_get_sql to return the command. It won’t work on sleeping spids.
Just checking what is the service pack on SQL, prior to SP3 it will not have that affect.
Satya SKJ
Microsoft SQL Server MVP
Writer, Contributing Editor & Moderator
http://www.SQL-Server-Performance.Com
This posting is provided AS IS with no rights for the sake of knowledge sharing. Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it.
]]>