Code:
Some part of your SQL statement is nested too deeply. Rewrite the query or break it up into smaller queries.
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






