I want to create a stored procedure that returns one text string that is the combination of a queries results from the same column. Is there a way to do this in SQL? The production server is still at SQL 2000. I will have no idea how many results I will need to combine with each call.
DECLARE @cString AS varchar(8000)
SELECT CompanyName INTO #MSR FROM Company
IF @cString = ''
@cString = RTRIM(#MSR.CompanyName)
@cString = @cString+', '+RTRIM(#MSR.CompanyName)