February 5, 2005 at 10:45 pm
Dear All
i would like to know what is the difference between a "Function" and a "Stored Procedures with recompile option". are they both same?
Thanks & regards
Rajiv.
February 5, 2005 at 11:42 pm
functions can be used in queries to return a value based on some parameter orwithout parameter
but we cannot use stored procedures in queris
<a href="http://www.websolsoftware.com"> For IT jobs click here</a>
*Sukhoi*[font="Arial Narrow"][/font]
February 6, 2005 at 12:31 am
hey sukhoi
thanx for the reply. apart from that reason there is no difference in "functions" and "stored proc with recompile option"?
regards
Rajiv.
February 6, 2005 at 7:07 am
Hi,
A couple of other differences:
Functions can't alter the state of the database, only retrieve data or perform calculations.
Procedures can, i.e. update, inserts and deletes are allowed.
Functions can be used as part of a select statement - procedures can't.
Olav
February 7, 2005 at 7:11 pm
Another nifty difference between Fn and SP is table variables. You can't pass table variables into stored procs - *darnit* - but you *can* call a function that returns a table variable. . .
ciao
E
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply