You are on page 1of 1

Differences between Stored Procedure and Functions?

Posted by: informaticareference on: 03/12/2012 In: Differences Leave a Comment

Stored Procedure Functions Stored procedure may or may not Function should return at least one return values. output parameter. Can return more than one parameter using OUT argument. Stored procedure can be used to Function can be used to calculations solve the business logic. Stored procedure is a pre-compiled But function is not a pre-compiled statement. statement. Stored procedure accepts more than Whereas function does not accept one argument. arguments. Stored procedures are mainly used Functions are mainly used to compute to process the tasks. values Cannot be invoked from SQL Can be invoked form SQL statements statements. E.g. SELECT e.g. SELECT Can affect the state of database Cannot affect the state of database. using commit. Stored as a pseudo-code in Parsed and compiled at runtime. database i.e. compiled form.

You might also like