Getting Row Column values as Row Headers in Sql Server

vishalneeraj-24503
Posted by vishalneeraj-24503 under Sql Server category on | Points: 40 | Views : 200
DECLARE @Column_Headers VARCHAR(MAX);
SELECT @Column_Headers = COALESCE(@Column_Headers + ',[' + cast(A.FIRST_NAME as varchar) + ']','[' + cast(A.FIRST_NAME as varchar)+ ']')
FROM EMPLOYEE_MASTER A --Where EMPLOYEE_ID IN(1,2,3,4,5,6,7,8,9,10);
print @Column_Headers;

Comments or Responses

Login to post response