I have this string that i am getting from .net application A,B,C,D,E,F,
I wanted to write a sql select statement like
set @string = \'A,B,C,D,E,F\'
You could keep it really simple with built-in sql functions:
set @string = 'A,B,C,D,E,F' select * from tbl_test where CHARINDEX(ISNULL(tbl_test.code, 'X'), @string) > 0
PATINDEX can be used in case you need more than one character.