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 indexes in sql?

574


What is row_number()?

578


List out what other servers you can use with ssrs?

89


How many levels of sp nesting is possible?

582


How many servers can we create in a single subscription?

146






How do I completely remove sql server instance?

566


What is transaction server isolation?

575


Explain mixed authentication mode of sql server?

541


Find nth lowest salary or get nth lowest salary?

593


Tell me the difference between clustered and non-clustered index?

510


What is the Difference Between Primary and Foreign Key?

585


What is the difference between row_number and dense_rank?

438


How many types of local tables are there in sql server?

503


List the different index configurations possible for a table?

512


What will be the value of @@fetch_status if a row that was a part of the cursor resultset has been deleted from the database after the time the stored procedure that opened the cursor was executed?

646