0% found this document useful (0 votes)
73 views

Differences Between Stored Procedure and Function

Stored procedures differ from functions in that stored procedures can perform multiple operations like business logic processing and database state changes using commit, are pre-compiled for faster execution, and can accept multiple arguments. Functions on the other hand are used to compute values, cannot affect the database state, are parsed at runtime rather than pre-compiled, and only return a single value rather than using output parameters.

Uploaded by

kdtftfjggjyhg
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views

Differences Between Stored Procedure and Function

Stored procedures differ from functions in that stored procedures can perform multiple operations like business logic processing and database state changes using commit, are pre-compiled for faster execution, and can accept multiple arguments. Functions on the other hand are used to compute values, cannot affect the database state, are parsed at runtime rather than pre-compiled, and only return a single value rather than using output parameters.

Uploaded by

kdtftfjggjyhg
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 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