Click here to Skip to main content
15,886,780 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
Hi Friends,

Good morning,

I need to know the difference between function and procedure in SQL.

every time in interview asked this questions.but I confused to answer.

Can u pls any one explain about it.


Thanks

Arul R
Posted

 
Share this answer
 
VB
Functions
----------
1) can be used with Select statement
2) Not returning output parameter but returns Table variables
3) You can join UDF
4) Cannot be used to change server configuration
5) Cannot be used with XML FOR clause
6) Cannot have transaction within function

Stored Procedure
-----------------
1) have to use EXEC or EXECUTE
2) return output parameter
3) can create table but won’t return Table Variables
4) you can not join SP
5) can be used to change server configuration
6) can be used with XML FOR Clause
7) can have transaction within SP
 
Share this answer
 
 
Share this answer
 
Simple

Just Google it.

Thanks.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900