So I have a stored procedure that accepts a product code like 1234567890. I want to facilitate a wildcard search option for those products. (i.e. 123456*) and have it return all those products that match. What is the best way to do this?
I have in the past used something like below:
*SELECT @product_code = REPLACE(@product_code, '*', '%')
and then do a LIKE search on the product_code field, but i feel like it can be improved.