Which approach is better to use if I need a member (sp or func) returning 2 parameters:
CREATE PROCEDURE Test
@in INT,
@outID INT OUT,
@amount DECIMAL OUT
AS
BEGIN
...
END
or
CREATE FUNCTION Test
(
@in INT
)
RETURNS @ret TABLE (outID INT, amount DECIMAL)
AS
BEGIN
...
END
What are pros and cons of each approach considering that the result will passed to another stored procedure:
EXEC Foobar @outID, @outAmount