---
title: "Difference Between Function and Stored Procedure"  
description: "1. A function is a subprogram written to perform certain computations and return a single value.   2. Functions must return a value (using the RETURN"  
author: "John Smith"  
published: 2010-11-24  
updated: 2014-09-18  
canonical: https://www.mindstick.com/blog/57/difference-between-function-and-stored-procedure  
category: "database"  
tags: ["database"]  
reading_time: 1 minute  

---

# Difference Between Function and Stored Procedure

1. A function is a subprogram written to perform certain computations and return a single value. \

2. [Functions](https://www.mindstick.com/forum/160140/explain-the-role-of-functions-as-a-service-faas-in-serverless-computing) must return a value (using the [RETURN keyword](https://www.mindstick.com/forum/156793/how-to-use-return-keyword-in-stored-procedure-in-sql-server)), but for [stored procedures](https://www.mindstick.com/forum/540/using-stored-procedures-with-entity-framework-in-an-asp-dot-net-application) this is not compulsory.

3. Stored procedures can use RETURN keyword but without any value being passed.

4. Functions could be used in SELECT statements, provided they don’t do any data manipulation. However, procedures cannot be included in SELECT statements.

5. A function can have only IN [parameters](https://www.mindstick.com/articles/87/passing-parameters-in-c-sharp), while stored procedures may have OUT or INOUT parameters.

6. A [stored procedure](https://www.mindstick.com/articles/803/using-stored-procedure-in-asp-dot-net) can return [multiple values](https://www.mindstick.com/forum/399/how-to-insert-multiple-values-selected-in-checkbox-in-database) using the OUT [parameter](https://www.mindstick.com/blog/450/parameter-class-in-c-sharp) or return no value at all.

##### For more details about Stored Procedure you can click on the link below..

\
https://www.mindstick.com/Articles/36/stored-procedure-in-microsoft-sql-server\

---

Original Source: https://www.mindstick.com/blog/57/difference-between-function-and-stored-procedure

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
