question

Benjamin avatar image
Benjamin asked

T-SQL fuzzy matching search

Please suggest a fuzzy matching option I can use in T-SQL for search operations. The following is a simplification of what I'm trying to do. I have a table called Databases (name varchar, instanceID int) which lists the database name and foreign key reference to a table which holds a list of SQL Server instances. I want to perform a search which will yield a list with 100% matches, LIKE matches, and fuzzy matches in that order. While I have most of this figured out, my question is: what is the best strategy to perform a fuzzy match?

I already have the equality and LIKE matches working. Also, using SOUNDEX, I am able to glean some fuzzy matches. However, the SOUNDEX seems to only match when the first few letters are the same and also produces some false positives. Other methods I have tried are matching only on the LEFT(x) characters and using REPLACE to eliminate spaces and punctuation. I need to do this all in T-SQL. What can you suggest to me?

other tags: fuzzy-matching, search

sql-server-2008t-sql
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Madhivanan avatar image
Madhivanan answered
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.