Monday, May 28, 2012

Difference Between Stored Procedure and Functions

Stored Procedure

Functions

have to use EXEC or EXECUTE

 can be used with Select statement

return output parameter

Not returning output parameter but returns Table variables

 you can not join SP

You can join UDF

 can be used to change server configuration

Cannot be used to change server configuration

 can have transaction within SP

Cannot have transaction within function

Cannot use in where,having clause

Can be use in where,having clause

Can be used functions in SPs

Cannot execute SP in Function


ITWORLD
If you have any question then you put your question as comments.

Put your suggestions as comments