April 10, 2007 at 12:27 pm
Is there any function in sql server to get the current stored procedure name.
Context is I want to log the stored procedure name into a table once the procedure starts.
April 10, 2007 at 2:21 pm
OBJECT_NAME(@@SPID)
_____________
Code for TallyGenerator
April 10, 2007 at 7:40 pm
isn't it @@proc_id? so object_name(@@proc_id), rather than the @@spid?
Lowell
April 10, 2007 at 7:54 pm
Sorry, being brain dead.
_____________
Code for TallyGenerator
April 10, 2007 at 11:40 pm
And for SQL Server 2005, you have to drop the underscore
SELECT OBJECT_NAME(@@procid)
N 56°04'39.16"
E 12°55'05.25"
April 11, 2007 at 3:52 am
Thanks. Thank you so much to all. It is working fine..
April 12, 2007 at 2:18 am
can any body tell me " How to create a procedure from two databases?"
April 12, 2007 at 2:24 am
You should start a new topic.
But... One way is to use fully qualified names.
N 56°04'39.16"
E 12°55'05.25"
Viewing 8 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy