Difference between Stored Procedure and Function in SQL

Stored Procedure vs Function

1)Functions must return a value. Stored procedure need not be.
2)Stored procedures can be called using EXEC command where as Functions can be called from another SQL Statement.
3)Stored Procedures are precompiled. Functions are not precompiled.
4)Generally Stored procedures are used for executing business logic where as Functions are used to execute computations .
5)Functions can return only one value at a time where as stored procedures can return more than one value at a time.
6)Functions cannot return Images and text.Stored procedures can return all types of datatypes.


Popular posts from this blog

CAML Query in SharePoint 2010

Calling REST APi from server side code - C#

All about SharePoint 2010 Content Type Hub

SharePoint Interview Questions and Answers

Calling ASP.Net WebMethod using jQuery AJAX