Getting Column Values with Comma Seperated in Sql Server.

vishalneeraj-24503
Posted by vishalneeraj-24503 under Sql Server category on | Points: 40 | Views : 199
Using COALESCE we can achieve:-
DECLARE @VALUE VARCHAR(max);
SELECT @VALUE = COALESCE(@VALUE + ', ', '') + CAST(Employee_Id AS varchar(50))
FROM Employee_Master;
Print @VALUE;

Comments or Responses

Login to post response