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

  • 7 February 2024
  • 7 replies

Userlevel 2
Badge +5

Hi ,


I am getting below error , its not the issue with reference as stated in 

This is is only coming in the acceptance environment.

The same set of data used in developement environment works well.

Can you please let me know what I am missing?




Best answer by Erwin Ekkel 8 February 2024, 13:20

View original

7 replies

Userlevel 7
Badge +22

Hi Rucha, 

This is usually due to a trigger that updates the same table that has an update trigger. That can result in this. There is an SQL Server database property for this called "Recursive triggers enabled”. You could set that to False. This will prevent recursive trigger execution. Might not be the solution you are looking for though, but does prevent this.

Userlevel 2
Badge +5

Thanks for the quick reply Mark.


I ran below query in the Db :


But still got the same error. 

Please let me know if I am missing something. :)

Userlevel 6
Badge +16

Like the error says, this might also imply a circular reference on a view, function or stored procedure. Is the subject you are trying to access a view? If so does the same error occur when accessing it from the database directly?

Userlevel 2
Badge +5

Hi Erwin,

This error occurs when I am using a task to create logistic order from a contract. So its trying to insert values from contract table to logistic order table.

The strange thing is, same data if I use in DEV env, its works. Its only giving error in the ACC env.


I am able to access both contract and logistic order tables from the database.

Userlevel 6
Badge +16

Try this: run the task on the database directly. Do you get the same error? If so, check the task control procedure code and the triggers for any loops. You could then deactivate part of the code or the triggers until you find the culprit. 

Userlevel 2
Badge +5

Thanks for the reply Erwin , I ran the task on database. And did not get any error. The entry in the logistic order was created. 

Userlevel 6
Badge +16

Then it seems like this is a gui problem. Try deactivating all details on that subject and run the task again.