A simple example of recursion using SQL Server and Common Table Expressions (CTEs). Thanks to +Nikola Gujanicic for the request.
Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.