• I heard you when you said this is a learning and growth exercise and not for production code. It seems likely that whatever you come up with will form a foundation for code that you do put into production...at least some day. This type of exercise has the ability to change your expectations of performance. I know the Tally table approach sure has changed mine.

    There are, without a doubt, many ways to skin this cat. In addition to getting it to work, the very important point of performance should be one of your goals. If at all possible, my advice would be to approach this with the goal of making it an Inline Table Value Function (ITVF) for the sake of performance. The answer I would give (using DelimitedSplit8K) has already been posted, so I won't post anything further on that, but if you have the time, spend it trying the different ways to solve the problem. This process will help you grow and understand the performance implications of doing things differently.

    If I could suggest one thing, it would be to test whatever you come up with on a 1M-row physical table. I find that it tends to expose weaknesses.

    Have fun with the exercise!