What is the difference between a Stored procedure and function?

Answer Posted / ruchi aggarwal

1.Functions can be used in select, where or case statement
whereas sp cannot.
2.In Functions we cannot modify the base table information.
DML statements cannot be used.
3.In Function non deterministic funstions are not used
whereas we can use them in sps eg:GETDATE
4.No Multiple result sets can be returned from function
whereas we can do this in sp.
5.Error handling is restricted. RAISERROR and @@ERROR are
invalid from inside User Defined Functions

Is This Answer Correct ?    0 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is xaml? Are xaml file compiled or built on runtime?

518


What are the new navigation controls in asp.net 2.0?

532


What are the HTML server controls in ASP.NET?

561


How do you implement sql caching in asp.net?

556


What is the use of global.asax file?

536






Describe the difference between inline and code behind - which is best in a?

567


What is query string?

561


What is asp.net caching?

572


In a page I have gridview with options of select and delete using hyperlink when I am selecting any one of then it has to open another page how can it?

499


About CLR, reflection and assemblies?

1533


Name the tools or API for developing or testing web api?

525


What do you mean by role-based security?

564


How about the security in Activex DLL and Activex EXE ?

1776


What is asp net_sessionid?

632


Define page output caching?

570