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
How to choose all records from the table?
Do you know hot add cpu in sql server 2008?
How can you manage sql azure security?
What are the two modes of authentication in sql server?
Difference between LEN() and DATALENGTH() in sql server ?
Which event (check constraints, foreign key, rule, trigger, primary key check) will be performed last for an integrity check?
Explain what are magic tables in sql server?
How to encrypt data between dialogs?
What is the process of normalization?
is it important for a database administrator to understand the operating system and file access? : Sql server administration
What you can do to delete a table without the delete trigger firing?
What is the recommended total size of your memory optimized tables?
What are the differences between lost updates and uncommitted dependencies?
Can you pass expressions to function parameters?
What are wait types?