Click here to monitor SSC
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in
Home       Members    Calendar    Who's On

Add to briefcase

General question regarding calling a SP from within other SPs Expand / Collapse
Posted Wednesday, September 1, 2010 12:36 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Tuesday, October 6, 2015 12:33 PM
Points: 285, Visits: 349
Hi. In general I strongly prefer to avoid calling one sp from another. But recently I had to write a sp that confused the living H**L out of me. So I split some of the logic to approx 6 general purpose utility SPs.

My main sp contains the transaction,error handling, and if logic. The utility procs are coded to be modular, simple and general purpose so they can be called outside of the calling proc (re-usable) even though they probably won't.

So basically I coded the SPs the way I might code a group of C# methods within an object.

My question to ya'll is one of general sp design and maintenance.

Do you prefer to create modular SPs with the intent of calling one from another. Or do you prefer to create larger (monolithic) SPs.

A large SP will be harder to debug but will reduce the sp count.
Small SPs are easier to string together and debug individually but result in a larger number of procs.

I would appreciate any input.

Bill, Charlotte NC

Post #979056
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse