What is difference Stored Procedure and Function?
Ankit Agarwal
stored procedure: 1.return more than one output value 2.We can call the function in the stored procedure 3.Allows select as wel as the DML statement like insert,update and delete 4.try catch is applicable Function: 1.Must return a single value. 2.We cant call the stored procedure inside the function 3.Allows only select statement 4.No try catch is allowed
1. Procedures can have input/output parameters for it whereas functions can have only input parameters. 2. Procedure allows select as well as DML statement in it whereas function allows only select statement in it. 3. We can go for transaction management in procedure whereas we can't go in function. 4. Procedures can not be utilized in a select statement whereas function can be embedded in a select statement.
Store procedure is the Group of Sql statements which is used to perform Insert,upadte,delete (CRUD)operations