How nice would be if you could design fancy-schmancy stuff in excel and plug that into your SQL process engine. Just image the possibilities, all those nasty algorithms you could come up with would be easily available to end users. Basically you would design what you wanted using a sample dataset in Excel with the same columns definitions as your real dataset. Somehow the you could drive your resultset through the excel engine and use the output. If you wanted to get fancy for larger datasets you could implement a mechanism where data could get streamed in chunks just large enough to surface the required calcs in Excel. E.g you are doing some time based calc that requires a full weeks worth of data to operate, you could then stream years worth of data in week chunks to the Excel engine. I bet this would beat the pants off of most complicated native sql based solutions as unless your well versed in sql and have a decent model within your control things start getting very slow very quickly for the average sql developer.