I have created a stored procedure that removes an order line and updates balances and totals on related tables.
I now want to create a stored procedure that removes an entire order. I was thinking of calling the stored procedure that removes the line for each line in the order.
Select * from orderlines where orderRef = 123
and then somehow call the sp_RemoveOrderLine(refNo, lineNo)
Can I call a stored procedure from within another stored procedure for each row?
Is it the best way of doing things or should I duplicate the code by creating sp_RemoveOrder with similar code?
I have had a search around and can't seem to find any help.
Ok with T-SQL but fairly new to stored procs.
Thanks in advance.
I now want to create a stored procedure that removes an entire order. I was thinking of calling the stored procedure that removes the line for each line in the order.
Select * from orderlines where orderRef = 123
and then somehow call the sp_RemoveOrderLine(refNo, lineNo)
Can I call a stored procedure from within another stored procedure for each row?
Is it the best way of doing things or should I duplicate the code by creating sp_RemoveOrder with similar code?
I have had a search around and can't seem to find any help.
Ok with T-SQL but fairly new to stored procs.
Thanks in advance.