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 are the types of table?

737


What does top operator do?

750


Detail about query optimizer?

801


To which devices can a backup be created and where should these devices be located? : sql server management studio

734


Can multiple columns be used in sql group by clause in ms sql server?

735






Explain external key management in sql server 2008

676


Name three of the features managed by the surface area configuration tool? : sql server security

719


What is the difference between insensitive and scroll cursor?

763


What is data compression? : sql server database administration

708


How you would rewrite the sql query to return the customerid sorted numerically?

760


Why do we need normalization?

665


What is the tcp/ip port on which sql server runs?

751


Do you know what is xpath?

727


Indexes are updated automatically is the full-text index also updated automatically?

795


Is there any performance difference between if exists (select null from table) and if exists (select 1 from table)?

696