I have a parameter @p1 = '1,2,3,4'
and I want to convert it to an int, so that I can query :
where PersonID in (@p1).
I tried :
where PersonID in cast(@p1 as int), but I get the following error:
"Conversion failed when converting the varchar value '1,2,3,4' to data type int."
Can anyone help me fix this?