Saturday, July 28, 2012

Difference between : Functions & Stored Procedure


Functions
·         can be used with Select statement
·         Not returning output parameter but returns Table variables
·         You can join UDF
·         Cannot be used to change server configuration
·         Cannot be used with XML FOR clause
·         Cannot have transaction within function

Stored Procedure
·         have to use EXEC or EXECUTE
·         return output parameter
·         can create table but won’t return Table Variables
·         you can not join SP
·         can be used to change server configuration
·         can be used with XML FOR Clause
·         can have transaction within SP

No comments:

Post a Comment