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

Can you explain full-text query in sql server?

554


Explain trigger classes i.e. Instead of and after trigger?

495


What's the information that can be stored inside a bit column?

553


List types of tables in SQL Azure?

102


System variable and temporary variables

1722






What is primary key index?

543


What is row_number function?

595


What are partitioned views?

586


How do you implement session management in SQL Server mode?

564


How to see existing views in ms sql server?

554


What is the command to change the recovery model?

571


What are the three different part of rdl file explain them?

172


What do you understand by intent locks?

581


How to get @@error and @@rowcount at the same time?

584


What will happen if a column containing char type data is changed to the nchar data type?

631