Database-Stored procedure (T-SQL)

Source: Internet
Author: User

Definition:

the stored procedure (Stored Procedure) is a large Database System , a set of SQL statements to complete a particular function, compiled and stored in a database, is executed by the user by specifying the name of the stored procedure and giving the parameter (if the stored procedure has parameters). Stored procedures are an important object in a database, and any well-designed database application should use stored procedures.

Advantages:

? ?

(1) Fast execution speed?

Stored procedure creation is done with syntax checking and performance optimizations that do not need to be compiled every time.

Storage on the database server, high performance.

? ?

(2) Allow modular design??

? you simply create a stored procedure once and store it in a database, and you can call the procedure any time in a program. Stored procedures can be created by people with expertise in database programming and can be individually modified independently of the program source code . ?

? ?

(3) Improve system security??

A stored procedure can be used as a conduit for user access to data. You can restrict user access to data tables, establish specific stored procedures for users to use, and complete access to data.

The definition text for a stored procedure can be encrypted so that the user cannot view its contents.

? ?

(4) Reduce network traffic?

??? an operation that requires hundreds of lines of Transact-SQL code is implemented by a separate statement that executes the procedure code without the need to send hundreds of lines of code across the network. ?????

Category:
    1. by parameter: without parameters, with parameters (with input parameters, with output parameters, with input and output parameters)

    2. ? by implementation: Custom stored procedures, system stored procedures

      ?

Common system stored procedures (SQL Server):


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.