all groups > sql server programming > october 2006 >
You're in the

sql server programming

group:

sysprocesses.sql_handle always = 0x0000000000000000000000000000000000000000


Re: sysprocesses.sql_handle always = 0x0000000000000000000000000000000000000000 Erland Sommarskog
10/31/2006 3:32:28 PM
sql server programming:
sauve mark (sauvemark@yahoo.com) writes:
[quoted text, click to view]

Note that there is only a value, if the process is currently executing
something. Also, beware that if a process goes into parallelism, there
are multiple entries in sysprocesses for the process, but only the
entry with ecid = 0 has a value in sql_handle, as I recall.


--
Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
sysprocesses.sql_handle always = 0x0000000000000000000000000000000000000000 sauve mark
10/31/2006 3:32:35 PM
Hi,



I'm using fn_get_sql() to inspect which line of code is currently being
executed by a particular process (spid), but I've noticed that in most cases
sysprocesses.sql_handle = 0x0000000000000000000000000000000000000000

And therefore fn_get_sql() return null

Is this a bug in SQL Server fixed by any patch? Or I'm missing something ?



I'm using SQL Server 2000 - 8.00.2039, Enterprise Edition on Windows NT 5.0
(Build 2195: Service Pack 4)



Thank you


Re: sysprocesses.sql_handle always = 0x0000000000000000000000000000000000000000 Aaron Bertrand [SQL Server MVP]
10/31/2006 5:10:58 PM
Probably because there is no context anymore.

Try

dbcc inputbuffer(<any such spid>)

AddThis Social Bookmark Button