I ended up using this function that I found on another forum
CREATE function CSVTable(@Str varchar(7000))returns @t table (numberval int, stringval varchar(100), DateVal datetime)asbegindeclare @i int;declare @c varchar(100);set @Str = @Str + ','set @i = 1;set @c = '';while @i <= len(@Str)beginif substring(@Str,@i,1) = ','begininsert into @tvalues (CASE WHEN isnumeric(@c)=1 THEN @c else Null END,rtrim(ltrim(@c)),CASE WHEN isdate(@c)=1 then @c else Null END)set @c = ''endelseset @c = @c + substring(@Str,@i,1)set @i = @i +1endreturnend
Then I just used
WHERE ID IN (SELECT numberval FROM CSVTable(@Param1))
Thanks for the helpCheers