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
 SQL Server 2000 Forums
 SQL Server Development (2000)
 get name of stored procedure

Author  Topic 

shmecher
Starting Member

10 Posts

Posted - 2005-02-10 : 10:37:42
Hi. I'm new to T-SQL and I would like to know if there is a function that gets the name of the stored procedure (in which the function is being called from).
Thanks

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2005-02-10 : 10:43:56
if you call this directly in the sproc:

select name from sysobjects where id = @@ProcId

Corey

"If the only tool you have is a hammer, the whole world looks like a nail." - Mark Twain
Go to Top of Page

TimS
Posting Yak Master

198 Posts

Posted - 2005-02-10 : 10:53:38
SELECT OBJECT_NAME(@@ProcID)

Should work also inside proc

Tim S
Go to Top of Page

Seventhnight
Master Smack Fu Yak Hacker

2878 Posts

Posted - 2005-02-10 : 10:56:05
thats what I couldn't think of !!

Corey

"If the only tool you have is a hammer, the whole world looks like a nail." - Mark Twain
Go to Top of Page

shmecher
Starting Member

10 Posts

Posted - 2005-02-11 : 14:40:54
Thanks guys
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 2005-02-11 : 15:23:38
SELECT * FROM INFORMATION_SCHEMA.ROUTINES

Brett

8-)
Go to Top of Page
   

- Advertisement -