Does calling one stored procedure from within another stored procedure impact performance at all? I have been unable to find any answers regarding this. If it does negatively impact performance, I suppose the only alternative is to combine the procedures as one larger one.
I know it negatively impacts performance to call functions within Sprocs (it’s better to just retype the code within the SProc) due to the way SQL plans query statistics, but I would imagine that is only true for functions.
Thanks in advance!
I have never seen a performance problem with a stored procedure calling another stored procedure per se.
However, I have seen transactions being far larger than necessary – causing serious performance issues – because developers expanded the inner stored procedure without understanding the consequences.
Here’s another problem example: there’s a “nice” stored procedure that is almost perfect for many scenarios, the coder uses it all over the place. However, the stored procedure actually returns double the number of columns 90% of the callers actually require. The calling code is not optimized.
This is why stored procedures should have only simple set-based logic, and why I’m against complex stored procedures with procedural logic and calls to other stored procedures.
So… best avoided IMHO.