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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Amit Kumar SinghRank #562 · 4.3K reputationPosted May 30, 2016, 2:05 AM EDT
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.Pawan Vaish25 reputationPosted May 30, 2016, 1:22 PM EDT
Ranjit Kanojia59 reputationPosted May 31, 2016, 2:26 AM EDT