C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
.NET
ADO.NET
Android
ASP.NET
C#
Databases & DBA
Design Patterns & Practices
iOS
Java
OOP/OOD
SharePoint
Software Testing
Web Development
WPF
View All
11
Reply
Difference between Stored Procedure and Function
Kalai
11y
2.8k
0
Reply
Delete Row
Delete Column
Insert Link
×
Insert
Cancel
Embed YouTube Video
×
Width (%)
Height (%)
Insert
Cancel
Table Options
×
Rows
Columns
First row as header
Create Table
Insert Image
×
Selected file:
Alignment
Left
Center
Right
Select an image from your device to upload
Upload to Server
Cancel
Submit
1) Procedure can return zero or n values whereas function can return one value which is mandatory. 2) Procedures can have input, output parameters for it whereas functions can have only input parameters. 3) Procedure allows select as well as DML statement in it whereas function allows only select statement in it. 4) Functions can be called from procedure whereas procedures cannot be called from function. 5) Exception can be handled by try-catch block in a procedure whereas try-catch block cannot be used in a function. 6) We can go for transaction management in procedure whereas we can't go in function. 7) Procedures cannot be utilized in a select statement whereas function can be embedded in a select statement.
Sarath Kumar
10y
1
1.Procedure can have Input Parameter and Output Parameter. Function only have Input Parameter. 2.For Stored Procedure Return type is not must. For function return type is must. 3.Stored Procedure Can have Try....Catch Function cannot have Try....Catch 4.Functions can be called from Procedure whereas Procedures cannot be called from Function
Sarath Kumar
11y
1
1- store procedure have input and output parameter, but FUNCITON: have only input parameter. 2-store procedure can do DML process, but FUNCTION can not do that. 3-store procedure return multiple value but FUNCTION return only one value. 4-In store procedure you can call FUNCTIONS but in Function you can't call store procedure.
Abduljamal Basha
9y
0
Functions can have only input parameters for it whereas Procedures can have input/output parameters .Procedures can have input, output parameters for it whereas functions can have only input parameters.
Nitin Choudhary
10y
0
http://www.c-sharpcorner.com/UploadFile/996353/difference-between-stored-procedure-and-user-defined-functio/http://dotnet-munesh.blogspot.in/2013/12/difference.html
Munesh Sharma
11y
0
Stored Procedure. 1)In sp we can do all dml operations ,in function only select operation is possible 2)In sp we can return more than one value ,in functions only single value is returned. 3)we can call functions inside sp, but we can't call sp inside functions.
Roymon TP
11y
0
Stored Procedure. 1)In sp we can do all dml operations ,in function only select operation is possible 2)In sp we can return more than one value ,in functions only single value is returned. 3)we can call functions inside sp, but we can't call sp inside functions.
Roymon TP
11y
0
function is preferred over stored procedure when some of the recurring functionality you want to implement inside database ( within database objects)where as stored procedure is preferred when want to implement recurring functionality between database and client application(e.g. .NET)
ashok rathod
11y
0
Function must return a value but in Stored Procedure it is optional( Procedure can return zero or n values).Functions can have only input parameters for it whereas Procedures can have input/output parameters .Function takes one input parameter it is mandatory but Stored Procedure may take o to n input parameters..Functions can be called from Procedure whereas Procedures cannot be called from Function.Advance DifferenceProcedure allows SELECT as well as DML(INSERT/UPDATE/DELETE) statement in it whereas Function allows only SELECT statement in it.Procedures can not be utilized in a SELECT statement whereas Function can be embedded in a SELECT statement.Stored Procedures cannot be used in the SQL statements anywhere in the WHERE/HAVING/SELECT section whereas Function can be.Functions that return tables can be treated as another rowset. This can be used in JOINs with other tables.Inline Function can be though of as views that take parameters and can be used in JOINs and other Rowset operations.Exception can be handled by try-catch block in a Procedure whereas try-catch block cannot be used in a Function.We can go for Transaction Management in Procedure whereas we can't go in Function.
Khan Abrar Ahmed
11y
0
1) Procedure can return zero or n values whereas function can return one value which is mandatory.2) Procedures can have input, output parameters for it whereas functions can have only input parameters.3) Procedure allows select as well as DML(INSERT/UPDATE/DELETE) statements in it whereas function allows only select statement in it.4) Functions can be called from procedure whereas procedures cannot be called from function.5) Exception can be handled by try-catch block in a procedure whereas try-catch block cannot be used in a function.6) We can go for transaction management in procedure whereas we can't go in function.7) Procedures cannot be utilized in a select statement whereas function can be embedded in a select statement.
Abhay Shanker
11y
0
1. Procedure can have Input Parameter and Output Parameter.
Function only have Input Parameter.
2. Procedure allow INSERT/UPDATE/DELETE Statement.
Function allow SELECT Statement only.
3. Procedure can handle Exception Handling.
Function cannot handle Exception Handling.
4. Procedure can call a Function.
Function cannot execute Procedure.
Kalai
11y
0
What is the difference between Classic ASP and ASP.Net?
Difference between Web Farm and Web Garden ?
Message