I want to perform a LIKE style comparison with an IN operator e.g.:
select *
from tbl1
where tbl1.value_to_check in (select allowed_str from allowedvalues)
Where allowed values could contain the following allowed_str:
ab% (allow any string starting ab)
%ab (allow any string ending ab)
The above query obviously does not work in this way however is there a way of achieving this using SQL Server 2008?
No,
INdoes not support this. Try:As Damien points out, if you are storing
ab%and%abseparately, rather than justabon its own, then you just need: