Hi,
I'm just starting out with SQL programming and would like a way to return an array in a stored procedure. Currently my stored procedure looks as follows:
Alter Procedure prcGetJobDrawings
@JobNoItemNo varchar(15),
@DrawNoItemNo varchar(15) output
AS
IF (SELECT COUNT(JobNoItemNo) FROM tblJobDraw WHERE JobNoItemNo = @JobNoItemNo) = 0
BEGIN
SELECT @DrawNoItemNo = NULL
END
ELSE
SELECT @DrawNoItemNo = DrawNoItemNo
FROM tblJobDraw
WHERE JobNoItemNo = @JobNoItemNo
This returns only the one value for DrawNoItemNo but now I'm facing situations where there are multiple DrawNoItemNo for each JobNoItemNo. How can I get it to return an array of these values? I'm calling this procedure through a seperate VB application and will be using the array in VB app if this helps.
Thanks for the help,
Mike
I'm just starting out with SQL programming and would like a way to return an array in a stored procedure. Currently my stored procedure looks as follows:
Alter Procedure prcGetJobDrawings
@JobNoItemNo varchar(15),
@DrawNoItemNo varchar(15) output
AS
IF (SELECT COUNT(JobNoItemNo) FROM tblJobDraw WHERE JobNoItemNo = @JobNoItemNo) = 0
BEGIN
SELECT @DrawNoItemNo = NULL
END
ELSE
SELECT @DrawNoItemNo = DrawNoItemNo
FROM tblJobDraw
WHERE JobNoItemNo = @JobNoItemNo
This returns only the one value for DrawNoItemNo but now I'm facing situations where there are multiple DrawNoItemNo for each JobNoItemNo. How can I get it to return an array of these values? I'm calling this procedure through a seperate VB application and will be using the array in VB app if this helps.
Thanks for the help,
Mike