What is difference between stored procedure and function?

Answer Posted / a.suresh

1.Stored Procedure return 0 to nth value where as function
return only one value which is must.
2.we can't use the stored procedure in select select
statement where as function can be used in the select statement.
3.we can use all the dml(insert,update,delete) commands in
stored procedure where as select statement only used in
functions.
4.we can use try catch in stored procedure where as in
functions cant.
function must be used with its schema where as stored
procedure used with out schema name
ex.dbo.function name

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is explicit cursors?

743


How do I install only the client tools of sql server 2000?

746


What is blocking?

727


Explain activity monitors

807


What is read committed?

771


How many types of stored procedures are there in sql server?

743


How to replace given values with null using nullif()?

730


What is difference between temp table and cte?

733


What is user defined stored procedures?

724


Explain nested join?

745


What are transactions in sql?

748


What is named calculation? : sql server analysis services, ssas

743


Do you know how to implement service broker?

699


How except clause is differs from not in clause?

719


How do you test your database? : sql server database administration

729