Function returning two values....?

  • Hi,

    Can we write a function,which returns two values...?

    Is it possible...?

     If yes,please give me a example...

    Thanks,

    Rao Aregaddan.

  • Scalar? No.

    Table-valued? Sure...

    CREATE FUNCTION SalesByStore (@storeid varchar(30))

    RETURNS TABLE

    AS

    RETURN (SELECT title, qty

    FROM sales s, titles t

    WHERE s.stor_id = @storeid and

    t.title_id = s.title_id)

    GO

    select * from SalesByStore(3)

  • Thanks For your solution...:-)

    Rao Aregaddan.

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

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