Store Procedures Vs User Defined Functions is MS SQL Server

SQL Server user-defined functions and stored procedures offer similar functionality. Both allow us to create bundles of SQL statements that are stored on the server for future use. This offers a tremendous efficiency benefit, as you can save programming time.

    1. Reusing code from one program to another

    2. Hiding the SQL details, allowing database developers to worry about SQL and application developers to deal only in higher-level languages

    3. Centralize maintenance, allowing you to make business logic changes in a single place that automatically affect all dependent applications.

Difference between the functions and stored procedures:

Stored procedures are called independently, using the EXEC command, while Functions are called from within another SQL statement.

Stored procedure allow you to enhance application security by granting users and applications permission to use stored procedures, rather than permission to access the underlying tables.

Functions must always return a value (either a scalar value or a table). Stored procedures may return a scalar value, a table value or nothing at all. Stored Procedures returns more than one value at a time while Functions return only one value at a time.

Add comment Share
Hosting Companies insights
1164 Web Hosting Reviews A trusted source of genuine reviews. Learn Reviews
2513 Web Hosting Companies Ever-growing pool of web hosting providers. Browse Providers
1916 Web Hosting Coupons Exciting web hosting deals available here Browse Coupons