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

Why do we use asp.net?

768


Explain the Session state management options available with ASP.NET?

759


How long does an http session last?

680


Explain server-side scripting?

759


What is difference Between Authentication and authorization?

788


What is autopost?

719


How does session work in asp net?

745


What is boxing and unboxing in asp.net?

826


How can you identify that the page is post back?

749


Differentiate between early binding and late binding.

766


What is the purpose of asp.net?

718


6. Tell us about a time when you failed to meet a deadline. What were the repercussions?

1928


What is page request in asp.net?

718


Why is string called immutable data type?

787


What is a postback url?

657