What are the differences between stored procedure and
functions in SQL Server 2000?

Answer Posted / prashant

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 can not be utilized in a select statement
whereas function can be embedded in a select statement.

Is This Answer Correct ?    22 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the differences between clustered and non-clustered index?

541


Explain the cursor lock types?

557


What encryption security is available in sql azure?

81


Give main differences between "Truncate" and "Delete".

582


What is mean by clustered index and non clustered index, give syntax of creation? : sql server database administration

592






How to recompile stored procedure at run time?

569


What is report rendering ?

102


what are triggers? : Sql server database administration

506


What is an execution plan?

569


What do you understand by hotfixes and patches in sql server?

519


What is a table called, if it has neither cluster nor non-cluster index? What is it used for?

600


What is raiseerror? What is raiseerror?

646


What is the use of “join” in sql server?

574


Does server sql treat char as a variable-length or fixed-length column?

588


What is open database communication (odbc)?

573