I am passing varchar
values to a SQL function.
But I get this error:
Msg 245, Level 16, State 1, Line 2
Conversion failed when converting the varchar value '201,505,59,43,2202' to data type int.
Sample Code :
Declare @Fault Varchar(Max) = '201,505,59,43,2202'
Select *
From EventMsg
Where Event IN (Convert(Int, @Fault))
I tried both CAST
& CONVERT
functions...but same error.