hi
-
:omg: can some body let me know what is the main diffrence between SQL function and Store Procedure. :cool:
Pavan Pareta
-
:omg: can some body let me know what is the main diffrence between SQL function and Store Procedure. :cool:
Pavan Pareta
-
:omg: can some body let me know what is the main diffrence between SQL function and Store Procedure. :cool:
Pavan Pareta
1.stored procedures allow default values for parameters user defined functions do not. 2.stored procedures allow you to use temp tables user defined functions only allow table variables. 3.you can use table valued user defined functions for normal table functionality such as joins, select *, etc. which can be useful sometimes. 4.both have cached execution plans. In general I would suggest to use procedures when you can and function only when a procedure won't do the job, just because it seems that functions could allow you to kill your performance when used in where clauses on queries with alot of rows, or even if used in select list on queries with alot of rows. Also functions calling functions makes sense to an application developer but doing something like that in your databse functions may be tempting, but imho is a bad idea.
-
1.stored procedures allow default values for parameters user defined functions do not. 2.stored procedures allow you to use temp tables user defined functions only allow table variables. 3.you can use table valued user defined functions for normal table functionality such as joins, select *, etc. which can be useful sometimes. 4.both have cached execution plans. In general I would suggest to use procedures when you can and function only when a procedure won't do the job, just because it seems that functions could allow you to kill your performance when used in where clauses on queries with alot of rows, or even if used in select list on queries with alot of rows. Also functions calling functions makes sense to an application developer but doing something like that in your databse functions may be tempting, but imho is a bad idea.
:rose::rose::rose::rose::rose::rose::rose::rose: Thanks M.H.1.2.3, thanks for Solution... :rose::rose::rose::rose::rose::rose::rose::rose:
Pavan Pareta