A couple of good SQL books that I am reading say that its good practice to design stored procedures to accomplish a single task. However, I see many examples (in the books) where an sp has multiple transactions, specifically, two or more inserts in a single sp. Question: is it OK to put two or even three inserts (into different tables) into the same sp? Is that considered a 'single task'? Seems to me it would be quicker and more efficient for the server. Or is it advisable to only include one Insert/Update/Delete per sp?
Thanks for any advice you can offer.
Thanks for any advice you can offer.