If you use =, you say "equals" which will not use wildcards.
If you use LIKE, which only works in text fields, it can use wildcards.
Cannot get wildcard matches with =.
Please note that depending on the data, a pattern search may perform a table scan, so I have to make sure you want it before allowing it.
For example, this will perform a table scan:
WHERE CustomerID LIKE '%1'
that is, all clients that have a client identifier (which is text) that ends with 1. This cannot be resolved using the index.
Final thoughts. I am not 100% sure, I understand exactly what you are asking. Could you clarify. What exactly do you mean by the word "pass a variable with a wildcard"?
source share