BQ Stored procedure to to get the SP name

Hello,

Thank you for contacting the Google Cloud Community.

Using the @@SPID and sp_who System Functions:

  1. Retrieve the current SP ID: Use the @@SPID system function to obtain the unique identifier of the currently executing stored procedure.
  2. Query sp_who: Execute the sp_who system procedure with the @@SPID as a parameter to retrieve detailed information about the running stored procedure, including its name.
  3. Store the name: Store the retrieved SP name in the audit table.

Regards,
Jai Ade