Inscrivez-vous ou connectez-vous pour rejoindre votre communauté professionnelle.
There are a lot of differences between function and Stored Procedures the basic difference is Stored Procedures are pre-compile objects which are compiled for first time and its compiled format is saved which executes whenever it is called. But Function is compiled and executed every time when it is called.
Function takes one input parameter it is mandatory but Stored Procedure may take o to n input parameters.
Procedure allows SELECT as well as INSERT UPDATE DELETE statement in it whereas Function allows only SELECT statement in it.
There are so many other differences.
Here are few simple differences between functions and stored procs
Also
User defined functions have three main categories:
Scalar-valued function - returns a scalar value such as an integer or a timestamp. Can be used as column name in queries.
Inline function - can have a single SELECT statement.
Table-valued function - can contain any number of statements that populate the table variable to be returned. They are useful when a set of rows need to be returned
Please let me know for any other information.