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

How to modify existing triggers using "alter trigger"?

733


What type of Index will get created after executing the above statement?

879


What is difference between view and materialized view?

733


you notice that the transaction log on one of your databases is over 4gb the size of the data file is 2mb what could cause this situation, and how can you fix it? : Sql server administration

748


What is an indexing strategy?

740


What is model database in sql server?

817


Explain temporary table vs table variable by using cursor alternative?

763


Benefits of Stored Procedures?

758


What are the dmvs?

804


How do I view a stored procedure in sql server?

770


When does a workload on SQL Azure get throttled?

127


What is 3nf normalization?

752


Is truncate autocommit?

748


Define model database?

766


What is side by side migration in sql server?

784