• I think I could help more if I understood what the overall objective is. Are you trying to get a scalar or table-type value from the procedure? If you are getting a scalar value, use an OUTPUT parameter or the intrinsic RETURNVALUE parameter:

    
    
    -- Output parameter
    DECLARE @OutputParam INT
    EXEC proc_GetLastKeyValue @Address, @OutputParam OUTPUT
    -- Return Value
    DECLARE @r INT
    EXEC @r = proc_GetLastKeyValue @Address

    Am I anywhere close to what you're asking for?