i have this query and its work fine for me
SELECT STUFF(
(SELECT ','+SLT_SubListName FROM sublists where SLT_SubListId in (1,2) FOR XML PATH('')),1,1,'');
but when i change the in parameters (1,2) into the ‘select SBS_SubListId from subscriber where SBS_SubscriberId=1’
which also return the 1,2
SELECT STUFF(
(SELECT ','+SLT_SubListName FROM sublists where SLT_SubListId in (select SBS_SubListId from subscriber where SBS_SubscriberId=1
) FOR XML PATH('')),1,1,'');
its giving me the error which is the following
Conversion failed when converting the varchar value ‘1,2,4,5’ to data type int.
if anybody needs i can also post my table schema here.
thanks
you have to first split these comma sepered values on comma bases, and then apply converrsion.