[From Narayana Vyas Kondreddi
This article shows you how to use the new function fn_get_sql() and the 3 new columns of master.dbo.sysprocesses. These changes were introduced in SQL Server 2000 SP3/SP3A. In this article, you will find a general purpose stored procedure called ShowCodeLine. It makes use of these new features, to inspect a given spid, and display the currently executing line/query.
Microsoft SQL Server 2000 SP3 (SP3A) has introduced many security fixes, changes in functionality, and new features. In this article, I'm going to discuss one of the new features introduced in SP3, the fn_get_sql() function and the 3 new columns added to sysprocesses system table.
The article continues at