Create table #abc(id int identity(1,1), val int default 2)
Insert into #abc default values
Select stuff((select ','+cast(id as nvarchar(max))+cast('-' as nvarchar(max))+cast(val as nvarchar(max)) from #abc for xml path('')),1,1,'')
Output Value getting truncated
Please help me
Answer by Kev Riley ·
When you say truncated, how are you seeing this?
If you are looking at this in SSMS, maybe you haven't set the output large enough?