How to get Function ID

  •  

    I want to know if this is possible. Currently, I am able to get the id of a stored procedure while it is executing by using @@PROCID which I got from this forum.

    Now I want to be able to retrieve the Id of a FUNCTION and pass id to another procedure/function while the code in the original function is executing.

    Create Function Tester

    ...

    ...

    ...

    Declare @funtionId Int

    Set @functionId = "the function Id"

    Exec proc1 @functionId

    Is this possible? If it is how can I get the function Id? Is there any sample code anywhere? Help.

     

  • USE @@PROCID for that too

    CREATE FUNCTION fn_1()

    RETURNS int

    AS

    BEGIN

     

     DECLARE @data AS int

     SELECT @data = @@PROCID

     RETURN @data

    END


    * Noel

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply