• I guess I am not getting somthing from your logic that is probably important that makes it RBAR. Even if the correct implementation in TSQL was a RBAR solution, unless you pull a full DataSet into CLR and do heavy complex mathematic processing almost in double recursive type looping, TSQL will likely be faster still, it is extremely hard to get ahead with SQLCLR in my experience. What is the total work flow for what you are trying to accomplish here? It sounds to me like maybe the expected processing could probably be done in a different manner, but I could be wrong. What would some sample data for each of the tables be and how would that data look on output.

    Jonathan Kehayias | Principal Consultant | MCM: SQL Server 2008
    My Blog | Twitter | MVP Profile
    Training | Consulting | Become a SQLskills Insider
    Troubleshooting SQL Server: A Guide for Accidental DBAs[/url]