Search code examples
sql-serversql-updatelookupfuzzy-search

Cleaning a Field value in a SQL table based on a Lookup


I would like to clean up field values based on a Lookup supplied by Client. Unfortunately Field has so many different combinations of names. E.g some clients names have combinations of "Limited" or "ltd". Some have missing spaces. What would be the best approach to cleanse this field based on a lookup supplied by Client.

SQL Extract


Solution

  • An idea is to use RegEx approach. The main idea is to create function in SQL Server that calls C# method in an assembly via SQL Server CLR. You have the entire code in the provided link.