Stored Procedure Design Rules

Source: Internet
Author: User
Stored Procedure Design Rules

The stored procedure design rules include:

  • The create procedure statement can include any number of SQL statements and types, except the following statements.
    These statements cannot be used anywhere in the stored procedure.

    Create Aggregate

    Create rule

    Create default

    Create Schema

    Create or alter Function

    Create or alter trigger

    Create or alter procedure

    Create or alter View

    Set parseonly

    Set showplan_all

    Set showplan_text

    Set showplan_xml

    UseDatabase_name

  • Other database objects can be created in the stored procedure. You can reference an object created in the same stored procedure as long as it has been created at the time of reference.
  • You can reference a temporary table in a stored procedure.
  • If you create a local temporary table in the stored procedure, the temporary table exists only for the stored procedure. After you exit the stored procedure, the temporary table disappears.
  • If another stored procedure is called, The called stored procedure can access all objects created by the first stored procedure, including temporary tables.
  • If you execute a remote stored procedure that changes the remote Microsoft SQL server instance, you cannot roll back these changes. Remote stored procedures are not involved in transaction processing.
  • The maximum number of parameters in stored procedures is 2100.
  • The maximum number of local variables in a stored procedure is limited by the available memory.
  • Depending on the available memory, the maximum storage process is 128 MB.

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.