Find and Replace Text in Strings in T-SQL


String manipulation is an inevitable task for developers and data professionals alike. Despite all the best efforts to normalize databases, eventually we are faced with some sort of text-based data stored within a relational database and need to extract detailed information from it.

Those of us who have tackled these challenges fully understand how code can quickly go from simple to absurdly complex, one function at a time. When the time comes to troubleshoot someone else’s endless block of spaghetti-code to determine what exactly it is trying to do, we realize that simple is always better.

This article is focused