In this example we want to list services followed by a service code.
DECLARE @List VARCHAR(8000);
SELECT @List = COALESCE(@List + ', ', '') + (ServiceCode)
FROM dbo.Services
WHERE ServiceID < 10;
SELECT @List;
In this example we want to list services followed by a service code.
DECLARE @List VARCHAR(8000);
SELECT @List = COALESCE(@List + ', ', '') + (ServiceCode)
FROM dbo.Services
WHERE ServiceID < 10;
SELECT @List;