I have a requirement to use a comma seperated string (which is a value in a table column) in \'IN\' clause of an SQL statement(SQL server 2008) For this I am using below sp
Why not try it this way
declare @Prefix2Include as Varchar(500) SELECT @Prefix2Include = Prefix2Include FROM dbo.vw_PrefixToInclude select * from dbo.fnSplit(@Prefix2Include , ',')
Select * From @t v Where v.EmpPrefix IN (select * from dbo.fnSplit(@Prefix2Include, ','))