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
What are the advantages of user-defined functions over stored procedures in sql server?
What is forward - only cursors / read only cursor?
Explain about Views?
How to create a simple table to test triggers in ms sql server?
Explain what is the use of custom fields in report?
What is perspective, have you ever created perspective? : sql server analysis services, ssas
How to insert new line characters into strings?
What is the difference between mysql and mysqli?
What are the fixed server level roles? : sql server security
Explain what are the different index configurations a table can have?
explain what is a deadlock and what is a live lock? How will you go about resolving deadlocks? : Sql server database administration
How to get a list all databases on the sql server?
What is sql server english query?
What is the default value of an integer data type in sql server 2005?
What is the name of the system variable that returns the number of rows affected by a SQL statement?