﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Administering / SQL Server 2005  / currently running stored procedure name / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Fri, 24 May 2013 03:27:53 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: currently running stored procedure name</title><link>http://www.sqlservercentral.com/Forums/Topic813548-146-1.aspx</link><description>Try this:SELECT r.*,t.text FROM sys.dm_exec_requests r cross apply sys.dm_exec_sql_text(r.sql_handle) tWHERE r.status IN (N'Suspended',N'Running',N'Runnable',N'Pending')The text column is the code of the procedure/batch that is currently running in SQL ServerIf all your SPs finish every quickly, the query may not be able to catch anything.You can try the following in a separate window then run the above query, you will catch itselect * from master.dbo.spt_valuesWAITFOR DELAY N'00:30:00'</description><pubDate>Wed, 04 Nov 2009 07:35:06 GMT</pubDate><dc:creator>peterhe</dc:creator></item><item><title>RE: currently running stored procedure name</title><link>http://www.sqlservercentral.com/Forums/Topic813548-146-1.aspx</link><description>not sure what you mean...inside a TSQL code block, you could use  [code]print object_name(@@PROCID)  [/code]or do you mean show me all the sql statements that are currently running on the server, like from one of the DMV's?[code]SELECT DEST.TEXT FROM sys.[dm_exec_connections] SDEC CROSS APPLY sys.[dm_exec_sql_text](SDEC.[most_recent_sql_handle]) AS DEST --WHERE SDEC.[most_recent_session_id] = @spid [/code]</description><pubDate>Wed, 04 Nov 2009 07:24:38 GMT</pubDate><dc:creator>Lowell</dc:creator></item><item><title>currently running stored procedure name</title><link>http://www.sqlservercentral.com/Forums/Topic813548-146-1.aspx</link><description>Is there anyway i can find out currently running stored procedure name ?</description><pubDate>Wed, 04 Nov 2009 05:49:48 GMT</pubDate><dc:creator>sreddyv26</dc:creator></item></channel></rss>