Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32).

  • Hi all

    I'm using a Stored Procedure which calls another, where as Second Stored Procedure is a Recursive on - which call's it self many times with one input parameter. While executing this stored procedure from the front end application (ASP.Net) i'm getting following error, this is due to recursive call of SP. The SP must be in the recursive form only, otherwise it will be a huge bulk of coding

    how to solve this problem.

    "Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32)."

    Thanks

    -Prakash.C

  • 32, which is the max. limit for nesting levels, can't be overriden by any means...

    But you can restrict the recursive execution using the function @@NESTLEVEL..

    IF @@NESTLEVEL < 32

    EXEC dbo.usp_myRecursiveSP....

    --Ramesh


  • I think you are getting a tree hierarchy.

    Just use a WHILE loop instead.


    N 56°04'39.16"
    E 12°55'05.25"

  • thank u Ramesh and Peter,

    Actuall Calling of SP is based on 2 Conditions, so i splited this single SP into 2 based on the condition now it's working fine

    Prakash.C

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

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