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.

Leave a Comment

RSS
YouTube
YouTube
Instagram