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 use go command in "sqlcmd"?
What are scalar functions in sql?
Why main is user defined function?
What is a matrix in ssrs?
How many replicas are maintained for each SQL Azure database?
How to how to convert numeric expression data types using the convert() function??
Explain time data type in sal server 2008?
What is difference between sql and sql server?
What is an execution plan? When would you use it?
What is rtm version in sql server?
What is the index requirement in SQL Azure?
what is the difference between a primary key and a unique key? : Sql server database administration
What is the difference between ROW_NUMBER and Ranking function in SQL SERVER?
what is the difference between Delete and Truncate command in SQL
What is SQL Azure Firewall?