Hello,
that's a common problem in my designs, and every time I think a lot about it and now I want to know what to do as a Standard rule in all my future designs >
Assume I have a Store of Items, I've a Purchase Orders and Receive Invoices, and I have two ways to get the balance/Credit:
1- I Usually don't make a transaction table, I just make a Views to collect data and calculate the In/Out Items.
cons: It would calculate all the PurchaseOrders and RecieveInvoices every time I want to know the balance.
2-Making a Transaction table with a field of the Last Balance.
cons: I should handle the Insert/Edit/Delete operations on Transaction table every time the happens on the PurchaseOrders or RecieveInvoice !!
what is the best way? or What is the wrong in my designs !?
thanks
w8ing your advice...
Loading
Amit ChoudharyPosted Feb 22, 2010, 4:58 AM
its up to you have no dynamic changes means need no external info to supply in updating transaction table you can use trigger.... but if every you time you have to pass different data associated with that transaction then you should storedProcedure is good.
Mohamed HamdyPosted Feb 22, 2010, 3:48 AM
thanks for answering me :)
but Should I handle this Operations on Transaction Table by Trigers on the on PurchaseOrder/RecieveInvoice Tables, or it's better to do this by stored procedure ?!
thanks
Amit ChoudharyPosted Feb 22, 2010, 1:45 AM
I suggest you to create and maintain transaction table. as it'll more reliable way to make and record each and every transaction.