I have a list of company names that I need to locate in the Companies
table in our database.
The list of company names that I have are NOT precise. They could be misspelled. Some contain special characters, etc.
I'm trying to create a "fuzzy search" SELECT
statement that will find the most likely matches in the Companies
table. I'm doing some "sanitization" before sending names that need to be matched by trimming spaces in the beginning or end of words, removing words like "The", etc.
I tried the FREETEXT
feature in SQL Server but the results were horrible. It pretty much returned all the rows in the Companies
table.
For exmaple, I did a search for 1-800-Flowers
but got all kinds of unrelated hits. What approach can I use to find the most relevant matches?