What is the difference between function and stored procedure
c#
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Ranjit PowarRank #553 · 4.4K reputationPosted Oct 25, 2014, 1:13 AM EDT
Abhishek KumarRank #510 · 4.8K reputationPosted Oct 25, 2014, 8:52 AM EDT
Please follow the below link
http://sqlhints.com/2012/06/16/difference-between-stored-procedure-and-user-defined-function-in-sql-server/
Abhishek
Lawrence Pond149 reputationPosted Oct 26, 2014, 9:09 PM EDT
- Table Valued Function returns table
- Scalar Values Function single result
- Aggregate Function
- System Functions
Stored proceduresTypcially functions are the building blocks single unit of work that a stored procedure uses and the stored proc is the container to do the work.
store procedures can return one or more results by using output field types
Functions call from inline sql
select fConcatString(n.FirstName, n.LastName ) from Names n ;
where you cannot run a stored procedure from a select statement.
Yadagiri ReddyRank #773 · 3K reputationPosted Oct 27, 2014, 6:01 AM EDT
----------
1) can be used with Select statement
2) Not returning output parameter but returns Table variables
3) You can join UDF
4) Cannot be used to change server configuration
5) Cannot be used with XML FOR clause
6) Cannot have transaction within function
Stored Procedure
-----------------
1) have to use EXEC or EXECUTE
2) return output parameter
3) can create table but won't return Table Variables
4) you can not join SP
5) can be used to change server configuration
6) can be used with XML FOR Clause
7) can have transaction within SP