Bagath
SSCrazy
Points: 2409
More actions
August 1, 2006 at 10:07 pm
#153116
Hi,
Can we write a function,which returns two values...?
Is it possible...?
If yes,please give me a example...
Thanks,
Rao Aregaddan.
Lance Sanders
SSC Eights!
Points: 903
August 1, 2006 at 10:38 pm
#652722
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)
August 1, 2006 at 11:17 pm
#652728
Thanks For your solution...:-)
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply