What is difference between stored procedure and function?

Answers were Sorted based on User's Feedback



What is difference between stored procedure and function?..

Answer / rakesh

mojor difference is
function must return a value but a
procedure may or may not return a value

Is This Answer Correct ?    8 Yes 1 No

What is difference between stored procedure and function?..

Answer / 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

What is difference between stored procedure and function?..

Answer / g.ashok

Stored Procedure need not to return a value.
Function should return a value.

Is This Answer Correct ?    1 Yes 0 No

Post New Answer

More SQL Server Interview Questions

When cursors are useful?

0 Answers  


What is explicit mode in sql server?

0 Answers  


What is the difference between a function and a stored procedure?

0 Answers  


we have emp table like Ename,EDOJ,EDOB with Column structure.but we want to know the employee Age.How? Any Body Plz

6 Answers  


What are all new concepts in SQL Server 2008? That is Exactly Difference between 2005 to 2008

2 Answers   IBM,






What are cursors?

8 Answers  


Explain log shipping?

0 Answers  


What are the difference between “where” and “having” clause in sql server?

0 Answers  


How do I find query history in sql server?

0 Answers  


Can I recover a damaged SQL Server 2008 database with the undamaged .mdb and .ldf files?

3 Answers   Apple,


what is a deadlock? : Sql server database administration

0 Answers  


what is integrated security (SSPI). why we use in the connection string?

2 Answers  


Categories