I have attached two documents that I need help with. The one is the script that I have written to access data and the other is the view structure that i want to access data from. The problem is that I'm working is SQL2000 and I want to print a card for the street trader. The street trader is selling more than one product, when I try to print the card for one trader it prints as many cards as the products that he's selling. What can I do, to make sure that it prints only one card.
Alter your function dbo.[ufn_Getdescription] as below
Code:
CREATE FUNCTION [dbo].[ufn_Getdescription] ( @rentID INT )
RETURNS VARCHAR(8000)
AS
BEGIN
DECLARE @Descriptions VARCHAR(8000)
Declare @Desc Valrchar(50)
Declare TmpCur For select [Description] From findstandbyidno where rent = @rentID
Open TmpCur
Fetch Next from TmpCur Into @Desc
Begin
if @desc is not null
set @Descriptions=@Descriptions + Case when @Descriptions='' then '' else ',' end + @Desc
Fetch Next from TmpCur Into @Desc
End
close tmpcur
Deallocate tmpcur
RETURN @Descriptions
END
Encourage the efforts of fellow members by rating
Lets not Spoon Feed and create pool of lazy programmers
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.