There has to be a way to do this, otherwise you couldn&#039t use SPROCS to update tables with shopping cart contents... read on<BR><BR>I have a shopping cart app in ASP. I don&#039t want to upload to the DB until the credit card goes through. Once the credit card goes through, I update my tables: Shipping(info), Orders, and Billing(info). <BR><BR>I&#039m not done yet though. I have to loop though the shopping cart and pass the paramters to an SPROC each time through the loop. If I have three items in the cart, then I need to call the SPROC three times.(let me know if there is a better way to do this)<BR><BR>So I am thinking I will need 2 SPROC&#039s, one for the first three tables, and one for the OrderDetail table. My concern is grabbing the proper foreign key from the Order table. If I use SELECT MAX(id), I may get the wrong ID if someone elses has inserted another row before I grab the proper ID. <BR><BR>I need to figure out how use my second SPROC to grab the proper ID from the Order table, and then insert that record into the OrderDetail table.(Am I being paranoid about another record being inserted? I think this could happen between the execution of my first SPROC and the second one.) <BR><BR><BR><BR>