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
List out the differences between global and local temp tables in sql server?
Explain use of expression builder.
What is the difference between local and global temporary tables?
What happens if you delete a table that is used by a view?
What are the new features of sql server 2008 r2 reporting service?
What are the requirements to use odbc connections in php scripts?
What is the purpose of self join?
Suppose you want to implement the one-to-one relationships while designing tables. How would you do it?
which backup strategy you are following at ur company
What is xml datatype?
How do I trace a query in sql server?
What is the security principal at the database level that represents your session?
How do I create an extended event in sql server?
What does this statement do @@rowcount?
Write a sql query to sort on different column name according to the parameters passed in the function?