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 the difference between delete table and truncate table commands? : Sql server database administration
I have all the primary data files, secondary data files as well as logs. Now, tell me can I still restore the database without having a full backup? : sql server database administration
What are the differences between union, intersect, and minus operators?
Can you pass expressions to function parameters?
What is the use of set nocount on/off statement?
What is cached report?
What is the importance of concurrency control?
How to get @@error and @@rowcount at the same time?
if no size is defined while creating the database, what size will the database have? : Sql server administration
Why are sql functions used?
How to enter unicode character string literals in ms sql server?
What are the two authentication modes in sql server?
What is index, cluster index and nonclustered index?
How do I start sql server 2017?
How can I check that whether automatic statistic update is enabled or not?