Difference Between Stored Procedure and Functions

Background

Many times in interview one question commonly asked  that  what is Difference Between
Stored Procedure and function, so by considering above requirement i have decided to write this blog to help Beginners and job seekers also who might be wants to know about it.

What is a Stored Procedure?

A Stored Procedure is a group of logical SQL statements to perform a specific task, such as insert, select, update and delete operations on a table and so on which is stored in a SQL database.

To know more about stored procedure Read my Article
Insert, Select, Update and Delete Records in a Single Stored Procedure Using SQL Server.

What is a function ?

Function is the logical group of SQL  statements which returns single value by performing the operation on group of SQL statements .it also stored in database.

storedVsfunctions.png

Summary
 
I hope this blog is useful for all readers and these differences are enough to impress interviewer  . If you have any suggestion then please contact me.