coalesce for comma separated in sql server
snippet in sql

coalesce for comma separated in sql server

user7743

DECLARE @List VARCHAR(8000)

SELECT @List = COALESCE(@List + ',', '') + CAST(OfferID AS VARCHAR)
FROM   Emp
WHERE  EmpID = 23

SELECT @List