I am creating an invoice which involves many stored procedures that I do not know how to put together and therefore I need to do some sort of begin commit and rollback in my c# code since I don't see a way to do it in sql server.
this is how I will be saving it
1. I generate an invoice #
2. I save an invoice header using the invoice #
3. Then I save the invoice details
I made a foreach loop and I loop through each row in the invoice and save it into the invoice detail database and within the same stored procedure I update the inventory based on the items in the invoice. Here I am going into the same procedure over and over until all the rows in the invoice are used up.
so I thought to somehow put a begin and commit around step 2 and 3.
Can anyone help me or does anyone have a better idea for me (maybe there is an answer in table value parameters)?
Debra has a question