What is difference between stored procedure and function?
Answers were Sorted based on User's Feedback
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 |
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 |
Answer / g.ashok
Stored Procedure need not to return a value.
Function should return a value.
Is This Answer Correct ? | 1 Yes | 0 No |
When cursors are useful?
What is explicit mode in sql server?
What is the difference between a function and a stored procedure?
we have emp table like Ename,EDOJ,EDOB with Column structure.but we want to know the employee Age.How? Any Body Plz
What are all new concepts in SQL Server 2008? That is Exactly Difference between 2005 to 2008
What are cursors?
Explain log shipping?
What are the difference between “where” and “having” clause in sql server?
How do I find query history in sql server?
Can I recover a damaged SQL Server 2008 database with the undamaged .mdb and .ldf files?
what is a deadlock? : Sql server database administration
what is integrated security (SSPI). why we use in the connection string?