Difference between Function and Procedure-in general?

Answer Posted / dharmendra nonia

Function and Stored Procedure both are precompiled objects
in databases but there is some difference between UDFs and
Stored Procedure such as--
1)Function Must be return at least one value but stored
procedure may or may not.
2)We can use Function for only data manipulation but stored
Procedure is used to Manipulation as well as Modification
of Data on tables.
3)We can't use DML statements inside Function but In stored
Procedure, we can use DML statements.
4)In stored Procedure, we can pass INPUT and OUTPUT
parameter but Function accept only input parameter and
return a value.

Is This Answer Correct ?    13 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what's the maximum size of a row? : Sql server database administration

537


What is the use of partition by in sql server?

504


Mention the differences between sql server and mysql.

503


Can an entity have two primary keys?

516


Explain how to integrate the ssrs reports in application?

516






What is statement level trigger?

537


How to divide query output into multiple groups with the group by clause in ms sql server?

561


What are the different methods available under sqlcommand class to access the data?

678


What is normalization? Explain different forms of normalization?

528


Can group functions be used in the order by clause in ms sql server?

581


How to create indexed view?

574


What are the common performance issues in sql server?

493


What is unpivot?

559


Can I use sql azure as a backup with log shipping or database mirroring?

136


How can we delete Duplicate row in table?

625