question

cornpoppy avatar image
cornpoppy asked

handel nested SQL statement in sql server

Hi,

My procedure has large query syntax ,many "nested if else" when i create it on one SQL server server get below error:

Some part of your SQL statement is nested too deeply. Rewrite the query or break it up into smaller queries.

but when i create that on another server,that is created without error ,i know the procedure has poor performance but why that is created correctly on another server

Does it depend on server config or database feature ?

sqlsql-serverstored-proceduresperformance-tuningsqlserver2014
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
cornpoppy avatar image
cornpoppy answered

i check the version of SQL Server

it is "Microsoft SQL Server 2014 - 12.0.2000.8 (X64)"

The stored procedure is created correctly after that version.

10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.