Not sure how this equates to two sprocs. Without knowning any of the business rules of your database, I assume, something like this would work:
CREATE PROCEDURE usp_ShipOrder
(
--Any Params
)
AS
if (SELECT Sum(NumberofCargo - CurrentNumOfCargo) From Ship where ShipID = value) > 0
Begin
--Space is available on the ship, add the record
End
Else
Begin
--Space is not available on the ship, exit
End
Does that make sense?
================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor / Author :.
Wrox Books 24 x 7
================================================== =========