difference between function and stored procedures
What is the difference between function and stored procedure in .Net technologies? kindly explain.
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Sanwar RanwaPosted Nov 19, 2019, 3:00 AM
Hi
Following are main difference between sp and funcation
Sam HobbsPosted Dec 13, 2025, 10:41 PM
I will assume you are asking about SQL Server since .Net does not have Stored Procedures. In .Net there are no functions, everything that might be called a function or procedure is called a method.
I asked Perplexity AI about one of the responses here and it found a StackOverflow answer that has the response posted here. See:
https://www.perplexity.ai/search/is-any-of-the-following-false-QWUS4nE2TW69IPfa7Ncupg#0
The following is a summary:
In computer science, functions can change other things (they are called side effects)
A function does not have to have parameters
In SQL Server:
a user-defined function must return a value
A SQL function can have zero parameters
SQL functions ... can read data and, in some systems, have observable behaviors like raising errors
The “cannot alter the data they receive as parameters” is misleading
At the end Perplexity AI says that the following is a technically defensible one-liner for SQL Server.
I also asked Perplexity AI about the currently accepted response. It says that Several of those lines are misleading or incomplete for SQL Server; see:
https://www.perplexity.ai/search/is-any-of-the-following-inaccu-cZz8JFmpSKWfvo3uAMWRaQ#0
Ajay GohilPosted Nov 20, 2019, 10:21 PM
Mageshwaran RPosted Nov 20, 2019, 6:17 PM
Puneet KankarPosted Nov 19, 2019, 10:24 AM
Jaimin ShethiyaPosted Nov 19, 2019, 5:12 AM
Following are the difference between SP and UDF.
Arun Kumar TiwariPosted Nov 19, 2019, 3:44 AM
2. Store Procedures can have input, output parameters but functions can have only input parameters.
3. Store Procedure allows select as well as DML(INSERT/UPDATE/DELETE) statements but function allows only select statement