SQL Server 2016-locally compiled Functions

Source: Internet
Author: User

SQL Server 2016-locally compiled Functions

The native compiled stored procedure is introduced in SQL Server 2014, and in SQL Server 2016, we will be able to implement a Scalar User-Defined Function (Scalar UDF) natively Compilation ).

SQL Sever compiles standard T-SQL statements into a proprietary intermediate language and explains it at runtime. In the case of local compilation, the stored procedure will be converted to C code and compiled into a DLL. SQL Server will use this DLL file during runtime.

Now, Scalar UDF can be compiled as machine code in a similar way. For simple operations, this process will greatly improve its performance. As long as the common Scalar UDF can be used, it can be converted to the Scalar UDF compiled by the local machine. In addition, it can also be used in locally compiled stored procedures. This is a huge victory for code reuse, because in SQL Server, this method is always considered to mean poor performance.

Like the locally compiled stored procedure, the locally compiled Scalar UDF must also be defined as bound to the schema bound ). In the stored procedure, the with schemabinding option indicates that local compilation is the expected method. It is unclear how this option applies to udfs, but as you can see, it must represent the function bound to the architecture. Perhaps it can automatically detect whether a UDF bound to the architecture can be compiled locally and perform corresponding actions based on different results.

Original ENGLISH: SQL Server 2016: Natively Compiled Functions

This article permanently updates the link address:

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.