[SQL] SQL statement is nested too deply

07/08/2018 00:37 #HB#1
Code:
Some part of your SQL statement is nested too deeply. Rewrite the query or break it up into smaller queries.
Have anyone got an idea about this error?

I had like 1954 lines in procedure, I reduced them to 501 and I still get that error.

The weird thing is that I get it at the same line after reducing lines!

SQL version: 2014 x64 ENU

07/08/2018 01:45 AceSpace#2
Quote:
Originally Posted by #HB View Post
Code:
Some part of your SQL statement is nested too deeply. Rewrite the query or break it up into smaller queries.
Have anyone got an idea about this error?

I had like 1954 lines in procedure, I reduced them to 501 and I still get that error.

The weird thing is that I get it at the same line after reducing lines!

SQL version: 2014 x64 ENU


Maybe we can help if you share the procedure? :rolleyes:
If you don't want to share, search on google for this error.
07/08/2018 01:53 #HB#3
Well, I can't throw my procedure just like this after writing about 2k lines.

I sent it to you in private.
07/08/2018 04:02 AceSpace#4
I helped the user and re-wrote his procedure which had very bad performance and design.

Code:
https://pastebin.com/2ufHvPLA
This code is pretty usable for model switchers, just change some stuff here n there and its great.