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 #temp and @table variable in SQL server?
What is the difference between mysql and sql server?
What are cursors stored procedures and triggers?
what is a transaction? : Sql server database administration
Is there any performance difference between if exists (select null from table) and if exists (select 1 from table)?
How to turn off warning messages during php execution?
If you are given access to a SQL Server, how do you find if the SQL Instance is a named instance or a default instance?
Write a program using SQL queries to find a unique entry in a table.
Do you know what is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting is possible?
Tell me when is the update_statistics command used?
Describe and explain about SQL native client?
what is sql server? : Sql server database administration
Define union, union all, minus, intersect?
How to join two tables in a single query in ms sql server?
what is create database syntax? : Sql server database administration