Splitting strings
Splitting strings
 

This topic comes up a lot. At least daily there's a new question that either explicitly or implicitly needs a solution requiring some kind of string splitter. As SQL Server has evolved, new functions like STRING_SPLIT (SQL Server 2016) and STRING_AGG (SQL Server 2017) have made these tasks a lot easier, which unfortunately makes older answers and blog posts less relevant and certainly less optimal. Here are some posts where I address specific solutions and overall strategy (including trying to avoid splitting strings inside SQL Server at all, even with the new function, if you can).

By: Aaron Bertrand

I am a passionate technologist with industry experience dating back to Classic ASP and SQL Server 6.5. I am a long-time Microsoft MVP, write at Simple Talk, SQLPerformance, and MSSQLTips, and have had the honor of speaking at more conferences than I can remember. In non-tech life, I am a husband, a father of two, a huge hockey and football fan, and my pronouns are he/him.