Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Administration
 Find what SP is runninG?

Author  Topic 

xrum
Yak Posting Veteran

87 Posts

Posted - 2011-11-17 : 16:21:54
hi, I am debugging some code and it keeps hanging. i ran the following:

execute sp_who2

DECLARE @sqltext VARBINARY(128)
SELECT @sqltext = sql_handle
FROM sys.sysprocesses
WHERE spid = 54
SELECT TEXT
FROM sys.dm_exec_sql_text(@sqltext)
GO

and found the SPID that is causing this... but it looks to be a stored procedure... (it's nowhere in the code to be found)

how can i find out which SP it's in? there's waaay to many to manually look through....

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2011-11-17 : 16:41:04
DBCC INPUTBUFFER(54)

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

xrum
Yak Posting Veteran

87 Posts

Posted - 2011-11-21 : 09:57:23
... i dont understand...
Go to Top of Page

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-11-21 : 10:35:15
She is suggesting that you run that command from a SSMS window to see the statement that was sent from client to the server. There is documentation here: http://msdn.microsoft.com/en-us/library/ms187730.aspx
Go to Top of Page
   

- Advertisement -