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 is a rownum?
Do you know how to implement service broker?
How to recompile stored procedure at run time?
How to sort query output in descending order in ms sql server?
Explain what is the difference between union and union all?
Are there any preferred steps that need to be taken care of before starting the installation of sql server 2000?
Name the different type of indexes in sql?
What is full outer join in sql server joins?
What is difference between rownum and row_number?
How do I find the sql server version?
Do you know what are pages and extents? : SQL Server Architecture
Can primary key be a foreign key?
New concepts of sql server 2005 use in your project.
What is “begin trans”, “commit tran”, “rollback tran” and “savetran”?
What is the difference between web edition and business edition?