Archive for January, 2011

T-SQL: Splitting one row into many

Something for your SQL toolbox…
I was recently challenged with needing to split a row into multiple rows (a quantity across multiple dates).
We were using a CURSOR, but the performance was horrible. When I converted it to a recursive CTE it went from 6+ minutes to a few seconds!
Below was my “theorem proof” before I implemented [...]