I ve been learning Functions and Stored Procedure for quite a while but I don t know why and when I should use a function or a stored procedure. They look same to me, maybe because I am kinda newbie about that.
Can some one tell me why?
Sommaire |
I ve been learning Functions and Stored Procedure for quite a while but I don t know why and when I should use a function or a stored procedure. They look same to me, maybe because I am kinda newbie about that.
Can some one tell me why?
Functions are computed values and cannot perform permanent environmental changes to SQL Server (i.e. no INSERT or UPDATE statements allowed).
A Function can be used inline in SQL Statements if it returns a scalar value or can be joined upon if it returns a result set.
License : cc by-sa 3.0
http://stackoverflow.com/questions/1179758/function-vs-stored-procedure-in-sql-server