String compare Stored procedure to return closest match
Posted on 2004-08-04
I have the following stored procedure where I have data coming from @promocode I want to find the closest match to the string supplied. Below is what I have so far which matches exactly...I want the match to work finding the closest string or the first string that matches even if its only 1 character that matches.
CREATE PROCEDURE FindCorrectPromoCode
SELECT PromoCode FROM BrandseedPromoCodes
WHERE PromoCode = @PromoCode