What is difference between stored procedure & function?
Answer Posted / khurram
1>Procedure can return zero or n values whereas function can
return one value which is mandatory.
2>Procedures can have input,output parameters for it whereas
functions can have only input parameters.
3>Procedure allow select as well as DML statement in it
whereas function allow only select statement in it.
4>Functions can be called from procedure whereas procedures
cannot be called from function.
5>Exception can be handled by try-catch block in a procedure
whereas try-catch block cannot be used in a function.
6>We can go for transaction management in procedure whereas
we can't go in function.
7>Procedures cannot be utilized in a select statement
whereas function can be embedded in a select statement.
| Is This Answer Correct ? | 17 Yes | 3 No |
Post New Answer View All Answers
What is an indexing strategy?
What is SQL Azure Federations?
What is a benefit of using an after insert trigger over using a before insert trigger?
What is forward - only cursors / read only cursor?
what are the steps you will take to improve performance of a poor performing query? : Sql server database administration
Can you change the data type of a column in a table after the table has been created? If so, which command would you use?
What is the filtered index?
What is the difference between varchar and varchar(max) datatypes?
Who developed sql server?
How to compose an inquiry to demonstrate the points of interest of an understudy from students table whose name begins with k?
How to return the date part only from a sql server datetime datatype?
What are advantages of ssrs or why we should use ssrs?
How to drop an existing user defined function in ms sql server?
Determine when an index is appropriate?
Is mysql better than sql server?