all groups > sql server programming > september 2006 >
You're in the

sql server programming

group:

How to get the SP name in the SP?


How to get the SP name in the SP? Cylix
9/13/2006 7:51:00 PM
sql server programming:
I have a sp name "dbo.helloWorld"
How can I get the it's name "helloWorld" in the sp?

Thank you.
Re: How to get the SP name in the SP? Hari Prasad
9/13/2006 9:49:27 PM
Hi,

You could use the function @@PROCID

Sample

Create Proc helloworld
as
Begin
select object_name(@@PROCID)
End

Thanks
Hari
SQL Server MVP




[quoted text, click to view]

Re: How to get the SP name in the SP? Dan Guzman
9/13/2006 9:59:14 PM
[quoted text, click to view]

You can pass the @@PROCID to the OBJECT_NAME function. For example:

SELECT OBJECT_NAME(@@PROCID)

--
Hope this helps.

Dan Guzman
SQL Server MVP

[quoted text, click to view]

AddThis Social Bookmark Button