What is the difference between Userdefined function and
stored procedure? Explain and give the example also

Answer Posted / ashwini

1. User defined functions can be used in select statements.
Procedures can not be used.

2. Functions must return some value. Procedures do not
always return the value.

3. Functions will take only input parameters. Procedures
can take input as well as output parameters.

4. Not all types of user-defined functions use
INSERT,UPDATE,DELETE statements(Only multi-statement table
valued functions can use). All procedures can use these
statements.

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are pessimistic lock and optimistic lock?

554


Why does sql studio use a single registered database repository? : sql server management studio

538


What are date and time data types in ms sql server?

533


Do you know what are the restrictions applicable while creating views? : SQL Server Architecture

560


What is collation?

717






If a table does not have a unique index, can a cursor be opened on it?

517


How to set database to be read_only in ms sql server?

557


what is blocking? : Sql server database administration

508


What is trigger and different types of Triggers?

580


what are the steps you will take, if you are tasked with securing an sql server? : Sql server database administration

560


Which joins are sql server default?

516


which backup strategy you are following at ur company

1737


You want to generate a report that is formatted as a chart. Can you use the report wizard to create such a report?

88


What is best institute to Learn DotNET And SQL in chennai?

1697


How to use subqueries with the exists operators in ms sql server?

592