Say I have a table called Person and a field called name. Data quality in the name field poor. I want to strip out all the none alpha characters e.g.
select Replace(Replace(Replace(Name,',',''),'&',''),'@') from Person
where Replace(Replace(Replace(Name,',',''),'&',''),'@') = @Name
@Name
is the variable passed in.
Using this there will be lots of Replace statements wrapped around each other. I have two questions:
- What characters would you strip out of a name search e.g. so if someone searches for Ian O' John, it will find Ian O John.
- Would you use another technique to do this e.g. PadIndex or regular expressions