Don't quite know what you meant by "dynamic". If you mean that they will come in as parameters, there are a few different ways you could handle it.One would be to put those values into a table and join on that. For example:DECLARE @Table2 TABLE(VALUE VARCHAR(32));INSERT INTO @Table2 VALUES ('v1'),('v2'),('v3');SELECT t1.name FROM Table1 t1INNER JOIN @Table2 t2 ON t1.VALUE = t2.VALUE
If you are getting the values as a string delimited parameter, you can first use a string splitter to split the string into the 3 tokens and use the above approach. Or, you could do something like this:DECLARE @parameterString VARCHAR(32) = 'v1,v2,v3';SELECT name FROM Table1WHERE ','+@parameterString+',' LIKE '%,'+VALUE+',%';
This assumes VALUE is a string column.