This has been asked many, many times. Two ways spring to mind:
If you have SQL2008, you can pass a "table value parameter" (tvp), where your table parameter has the values for your "in" clause, then have a "where" clause that checks values are "in (select whatever from tvp)".
If you do not have SQL2008, you can use a "common table expression" (cte), such as...
declare @t table (xyz varchar(100))
insert into @t values ('hello')
insert into @t values ('there')
insert into @t values ('world')
insert into @t values ('10')
insert into @t values ('20')
insert into @t values ('30')
declare @a as varchar(120)
set @a = 'hello,10,30'
;with cte as
(
select cast(null as varchar(max)) as 'v', 1 as s, charindex(',' , @a, 0) as e
union all
select cast(substring(@a, s, e-s) as varchar(max)), e+1, charindex(',' , @a + ',', e+1)
from cte where e!=0
)
select *
from @t
where (xyz in (select v from cte where v is not null))
In this example (above), the string @a is the comma separated list of values you want for your "in" clause, and the (recursive) cte just strips out the values, one by one. Of course, this is just a quick example and would probably need checks for empty strings, successive commas, and the like.
Of course, the usual caveats apply with regard to using SQL to (effectively) do string manipulation.
Regards,
Ross