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

Do you know what are the restrictions that views have to follow?

863


What is use of except clause? How does it differ from not in clause?

792


How to select an exiting database using mssql_select_db()?

723


Are resultset updatable?

750


what’s the difference between Covering Indexes and Clustered Indexes ? how to use clustered index small ?

1793


Explain intellisense for query editing

812


Do you know how to implement service broker?

747


Tell me when is the update_statistics command used?

779


What is wide table?

753


Explain trigger and trigger types?

775


Explain what is sql server english query?

810


What are four major operators that can be used to combine conditions on a where clause?

817


What is the largest component inside a field?

801


What is the difference between web edition and business edition?

105


What is the difference between dbcc indexdefrag and dbcc reindex?

755