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
Suppose you want to implement the one-to-many relationships while designing tables. How would you do it?
What is the difference between a unique key and primary key?
Explain log shipping and mention its advantages.
Can we hide the definition of a stored procedure from a use?
How many types of relations are there between dimension and measure group? : sql server analysis services, ssas
Can two tables have the same primary key?
What happens if you are trying to access a schema not owned by you?
What are the advantages of partitioning?
What is data source document?
How to provide login information for a new odbc dsn?
Does partitioning ssd reduce performance?
How do triggers work?
Disadvantages of the indexes?
When columns are added to existing tables, what do they initially contain?
What is an index in sql?