Sunday, December 11, 2011

Difference Between SQL Functions and Stored Procedure


StoredProcedure Functions


StoredProcedure has out parameter Functions doesn't have any out parameter
It will return value datatype must be integer It will return value as any datatype
including the user defined datatype
except BLOB, cursor and time stamps
Return value is used as indication whether
execution was success or failure
Unlike stored procedure return value
is to serve a meaningful piece of data
Return value can't used directly in query,
 it has to be stored somewhere before
it's used in query
Return value can be used directly in
query as result.
Stored Procedure will return scalar value Storedprocedure will return scalar value as table



No comments: