|
database
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
How to get the SP name in the SP?I have a sp name "dbo.helloWorld"
How can I get the it's name "helloWorld" in the sp? Thank you. Hi,
You could use the function @@PROCID Sample Create Proc helloworld as Begin select object_name(@@PROCID) End Thanks Hari SQL Server MVP Show quote "Cylix" <cylix2***@gmail.com> wrote in message news:1158202260.707579.30820@m73g2000cwd.googlegroups.com... >I have a sp name "dbo.helloWorld" > How can I get the it's name "helloWorld" in the sp? > > Thank you. > > How can I get the it's name "helloWorld" in the sp? You can pass the @@PROCID to the OBJECT_NAME function. For example:SELECT OBJECT_NAME(@@PROCID) -- Show quoteHope this helps. Dan Guzman SQL Server MVP "Cylix" <cylix2***@gmail.com> wrote in message news:1158202260.707579.30820@m73g2000cwd.googlegroups.com... >I have a sp name "dbo.helloWorld" > How can I get the it's name "helloWorld" in the sp? > > Thank you. > |
|||||||||||||||||||||||