SQL Server Stored Procedures

Source: Internet
Author: User

Last semester in the company's internship in the company's national map of the project, found that the front-end of the rapid search, statistical analysis and so on is actually called the database server side of the stored procedures or views, before the school at the time of the stored procedure Mengmengdongdong, do not know how to use the specific how to achieve the purpose of optimization, Recently viewed a lot of data, think the stored procedure is really useful.

1. Improve performance

The execution of the SQL statement needs to be compiled first, the stored procedure is a set of SQL statements in order to complete a specific function, it can be compiled once, the next execution is no longer compiled, so that the front-end calls can improve the efficiency of the operation, and the more the number of calls is basically the faster.

2. Security

Stored procedures on the database server side, in front of only need to call the name and parameters on the line, to prevent SQL injection; In a graph project, the company specifically developed a datacenter is the Data Transformation Center, all the query and statistical analysis are written to the service, so that only the front end needs to invoke services, Configuring the name and parameters of the stored procedure that needs to be called returns the desired effect for the user.

3. Reduce network traffic

You only need to pass in the name and parameter values of the stored procedure, and do not transfer the full SQL to save traffic.

4. Encapsulation

A method that can be used to manipulate a database object, and the user only needs to know its input and output parameters and understand its purpose.

5. Importance

For complex logic, the application of stored procedures that have been tested is not prone to errors.

SQL Server Stored Procedures

Related Article

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.