Let me know any one who know the answer....
In which scenario will use stored procedure and a function?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Ranjit KanojiaPosted May 31, 2016, 6:26 AM
Pawan VaishPosted May 30, 2016, 5:22 PM
Amit Kumar SinghPosted May 30, 2016, 6:05 AM
There's no magically performance boost from either one. If they contain the same code, they'll have the same performance.
I'd say, keep it as a function unless or until you reach a limitation of functions - e.g. if you want to actually change database state.
Functions are more composable - you can call them directly from within other statements such as
SELECT- whereas stored procedures have to be explicitly called.