Retreiving SP name using T-SQL Script

Some of us when executing a Store Procedure in SQL Server want to insert a record into the table with the current procedure name that is executed (this can especially useful when the procedure name is stored in the exception tables when there is an error in the execution of the SP)

Below is the query to find the current proc name using T-SQL Script:


In the SP , we can write as

INSERT INTO Exception_Table(ProcedureName)

Have a nice day !

Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

  • Recent Posts

    • 450,717 hits
  • Join 37 other followers

  • Archives

  • Categories

  • December 2011
    M T W T F S S
    « Nov   Nov »
  • Advertisements
%d bloggers like this: