Pages

Monday, November 30, 2009

Store Procedures Vs User Defined Functions

Store Procedures

User Defined Functions

1

A stored procedure is a program (or procedure) which is physically stored within a database.

A user-defined function is a routine that encapsulates useful logic for use in other queries.

2

Procedure can return zero or n values.

Function returns only one value which is mandatory.

3

Procedure can have Input, Output Parameter.

UDF can have only Input Parameters.

4

Procedure allow select as well as DML statement in it

Functions allow only select statement in it.

5

Procedure can not be called from function.

Functions can be called from Procedure

6

We can go for transaction management in procedure

In function We can’t

7

Procedures can not be utilized in a select statement

Functions can be embedded in a select statement.

0 comments:

Post a Comment