• create table #t1

    (id varchar(5))

    insert into #t1 values('xyz'), ('kkl'), ('tln'), ('cxz'), ('dfa'), ('tprq')

    select * from #t1

    Declare @p1 varchar(50) = 'xyz,tln,tprq'

    Declare @p2 varchar(50) = ''''+replace(@p1, ',', ''',''')+''''

    select @p1

    select @p2

    select * from #t1 where id in(@p2)

    Why teh last select does not return any value inspite of @p2 having the correct presentation of condition ?