• Here is my function and stored procedure

    Create Function getCalcvalue

    (@Param1 as integer,

    @Param2 as integer ) returns integer

    Begin

    declare @setVal as integer

    -- select techVal from Pt101Tbl where col1 = @param1 and col3 = @param2

    set @setval = ---calculations based on techVal

    return @setVal

    End

    ALTER PROCEDURE [dbo].[sp1]

    @value1 as integer,

    @value2 as integer,

    @value3 as integer

    AS

    begin

    declare @setval as integer

    set @setVal = getCalcvalue(@value1,@value2)

    -- based on value i receive from function there are fuether select statements

    End