T-SQL Gap-Filling Challenge


 

A student of mine sent me a T-SQL challenge involving gap-filling of missing dates and balances. I found the challenge interesting and common enough and figured that my readers would probably find it interesting to work on as well.

I’ll present the challenge and three possible solutions, as well as the results of a performance test. AS always, I urge you to try and come up with your own solutions before looking at mine.

If you would like to download the code including the solutions, you can find it in a .zip file here.

The Challenge

The challenge involves two