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.
Share on Google Plus

Please write your comment below. Share this blog on Social media.


Post a Comment

Dear Readers, Please post your valuable feedback in the comment section if you like this blog or if you have any suggestions. I would love to hear the same from you. Thanks