I have a small problem. I am getting this error, and I would appreciate if anyone could help me out! All I am trying to do is a comma delimited list.
SET NOCOUNT ON;
DECLARE @TypeID Varchar(250)
SELECT
@TypeID = COALESCE(@TypeID +',' ,'') + TypeID
FROM
Related
RETURN @TypeID
Conversion failed when converting the varchar value '8,' to data type int.
Does anyone know how to fix, please? I've tried CONVERT(VARCHAR, @TypeID) but this doesn't seem to make any difference!
Is the field TypeId in the related table an integer? You would need to cast the database field to a varchar for your code to work
Select @typeId = coalesce(@typeId+',','') + cast(typeId as varchar(20))
from related
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With