.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> Sql Server >> Post New QuestionBookmark and Share Subscribe to Forum

how to get the currently executing Stored Procedure name

Posted By: Sajid P K     Posted Date: November 30, 2010    Points:2   Category :Sql Server
how to get the currently executing Stored Procedure name ?

Responses
Author: SureshM             
Posted Date: December 01, 2010     Points: 5   

Hi,

CREATE PROCEDURE [dbo].[GetCurrentSP]

AS
BEGIN
SET NOCOUNT ON;
insert into tblLog values(object_Name(@@PROCID),getdate())
select * from tbllog
END

Author: Pandian             
Posted Date: February 10, 2011     Points: 5   

Hi

To identify what are the Procedures getting executed in a particular database

USE Database
GO

SELECT DB_NAME(Q.[dbid]) [Database Name],
Q.[text] [Procedure Text]
FROM sys.dm_exec_connections C CROSS APPLY sys.dm_exec_sql_text(C.most_recent_sql_handle) Q
WHERE OBJECTPROPERTY(Q.objectid,'IsProcedure') =1


Cheers
www.sqlserverbuddy.blogspot.com

If not I then who, If not now then when


Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend