September 11, 2008 at 11:50 pm
HI,
After running dbcc inputbuffer() , I get the stored procedure currently executing in sql. Please let me know how do I get the exact statement that is executing in that stored procedure.
Running the profiler would server my requirement, however my concern is to get the sql query.
Thanks
September 12, 2008 at 12:56 am
Try this one:
DECLARE @sql_handle-2 VARBINARY(20)
SELECT @sql_handle-2= SQL_HANDLE FROM MASTER.DBO.SYSPROCESSES
WHERE DBID=DB_ID('db name')
SELECT TEXT FROM ::FN_GET_SQL(@SQL_HANDLE)
Thanks,
Amit Khanna
September 12, 2008 at 3:49 am
Have a look at this site:
http://vyaskn.tripod.com/fn_get_sql.htm
[font="Verdana"]Markus Bohse[/font]
September 16, 2008 at 3:15 am
HI Markus Bohse
Thanks a lot the link was really usefull.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply