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 are the new security features added in sql server 2012? : sql server security
What do you know about normalization and de- normalization?
what is database replicaion? What are the different types of replication you can set up in sql server? : Sql server database administration
What is the default value of an integer data type in sql server 2005?
How to get a list of columns in a view using the "sp_help" stored procedure?
You have a table with close to 100 million records recently, a huge amount of this data was updated now, various queries against this table have slowed down considerably what is the quickest option to remedy the situation?
Insert syudents details in table.Current system date &time insert into joining time.How do insert?( in sysdate only return current system date how do add time?)
How to delete existing triggers using "drop trigger"?
What are the events recorded in a transaction log?
What is blocking?
explain different types of cursors? : Sql server database administration
Tell me what is the order in which the sql query is executed?
How to get the definition of a stored procedure back?
Is truncate autocommit?
What are the properties of primary key?