Merge Multiple Rows into a Single Row in SQL Server
In Some times Need Multiple Rows into single row and combine column SQL. this is My Table Studenttbl I Shown All RollNo And I Merge to Single Row. for Use Following SQL Query. declare @Roll as varchar ( max )= '' select @Roll = substring ( ( select ' ,' + RollNo AS 'data()' from tbl_Studentdtl for xml path ( '' )) , 3 , 255 ) select @Roll RoleNo