SQL issue: The maximum number of nested layers exceeded for a stored procedure, function, trigger, or view (maximum number of layers is 32)

Source: Internet
Author: User

1. The source code for the problem is as follows:

 create procedure P4  @avggrade int asselect CNO, avg (Grade ) from Scgroup by Cnohaving avg ( Grade) >  @avggrade  @avggrade = 80                 

Although no error, but run a lot of results come out

Solve:

CREATE PROCEDUREP4@avggrade int  asSELECTCNO,AVG(grade) fromSCGROUP   byCNO having  AVG(grade)> @avggrade GOEXECUTEP4@avggrade =  the

Add a go after the storage process ..... Although I do not know why ...

Reference article:

Http://www.cnblogs.com/furenjun/archive/2008/03/12/sqlerror.html

SQL issue: The maximum number of nested layers exceeded for a stored procedure, function, trigger, or view (maximum number of layers is 32)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.