I am using SQL Server 2008 and need to write a query that should return a record of ABCDEFGH if a user enters a search string such as ABCD-EFGH or ABDEFGH etc (i.e. records that are similar to).
How would I accomplish that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
you need to employ some sort of editDistance algorithm i.e Levenshtein distance ,Jaro–Winkler distance to calculate the difference between 2 strings.
look at this thread for Levenshtein distance implemented as udf
Levenshtein distance in T-SQL
you will use the UDF like this (just an example)