Click here to Skip to main content
15,892,072 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Please tell me these differences are correct or wrong:


SQL
Procedure can return zero or n values whereas function can return one value which is mandatory.
Procedures can have input/output parameters for it whereas functions can have only input parameters.
Procedure allows select as well as DML statement in it whereas function allows only select statement in it.
Functions can be called from procedure whereas procedures cannot be called from function.
Exception can be handled by try-catch block in a procedure whereas try-catch block cannot be used in a function.
We can go for transaction management in procedure whereas we can't go in function.
Procedures can not be utilized in a select statement whereas function can be embedded in a select statement.
Posted

 
Share this answer
 
 
Share this answer
 
Comments
yogika 18-Jan-13 1:55am    
thanx shona actually I answered same answers in interview but he refused.and told those are wrong so i got confused.

one more difference I said that sp is pre compiled code and while fun get compiled every time it is called.

but he also rejected this answer.
The Doer 18-Jan-13 2:00am    
Offer him a glass of cold water, let him Emollient..
Better to read this

http://www.dotnetspider.com/resources/35276-Difference-between-Stored-Procedure-Function.aspx[^]

Don't except spoon feeding from this portal.
 
Share this answer
 
Comments
yogika 18-Jan-13 2:11am    
sorry I am new to forum.I wont trouble you all more.
RDBurmon 18-Jan-13 2:22am    
Ok fine if link is useful then accept answer and vote it so that we can close your question

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