Is there a work-around for SQL Server's recursion limit of 32?

  • We have a BOM table where the parent and children have a many-to-many relationship. Since each parent can have more than two children, it is not a binary tree. I created a recursive stored procedure that works well in SQL Server 2005 but fails in SQL Server 2000 with an "Invalid cursor state error". I believe that it is due to SQL Server 2000's recursion limit of 32. Does anyone know of a way around this limit?

  • may be able to help of u post what u have

  • No... cannot change the limit in SQL Server 2000.

    Yes, you can work around it... take a look at "Expanding Hierarchies" in Books Online for details.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply