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
How to find the login name linked to a given user name?
What is checkpoint in sql server?
Where are full-text indexes stored?
can a database be shrunk to 0 bytes, if not, why? : Sql server administration
Does index speed up select statements?
What are recommended options to be used while using db mirroring? : sql server database administration
What is transact-sql language?
How to delete multiple rows with one delete statement in ms sql server?
How to filter out duplications in the returning rows in ms sql server?
How to provide default values to function parameters?
What is advantage data architect?
What is row_number () and partition by in sql server?
What is factless fact table? : sql server analysis services, ssas
How to download and install the scaled-down database adventureworkslt?
How to get the definition of a stored procedure back?