Difference between store procedure and function
|
Procedures |
Functions |
| 1. |
Procedures can have input,output parameters |
Functions can have only input parameters |
| 2. |
Procedures cannot be called from function |
Functions can be called from procedure |
| 3. |
Exception can be handled by try-catch block in a procedure |
Try-catch block cannot be used in a function. |
| 4. |
Transaction management can be done in procedure |
Cant write transaction in a function. |
| 5. |
Procedure may or may not return a value |
Function will alaways returns a value |
Asp.net, Ado.net, .Net Remoting, .Net
Webservice, SQL, XML, XSLT, WCF, WPF, WWF NHibernate, Ajax, Jquery, DHTML