Thursday 10 May 2012

comma separated values in sql



DECLARE @text NVARCHAR(MAX)
SELECT @text = COALESCE(@text+', ','') + StateName  FROM State_master
SELECT @text

No comments:

Post a Comment