Note that there are some explanatory texts on larger screens.

plurals
  1. PONested Trigger problem
    primarykey
    data
    text
    <p>I am working on a solution where sql triggers are called in a nested fashion, I will explain the problem later on let me first introduce you the tables first. </p> <ol> <li>BillDetails</li> <li>SubProductAtLocation</li> </ol> <p>Yes, this is an erp designed for a retail store, Bill details table consist of rows bill Items</p> <p><strong>billDetails</strong></p> <ol> <li>RowID</li> <li>BillID</li> <li>SubProductID</li> <li>MRP</li> <li>quantity</li> <li>Tax</li> <li>Discount</li> </ol> <p><strong>subproductLocation</strong></p> <ol> <li>RowID</li> <li>SubproductID</li> <li>LocationID</li> <li>Quantity</li> <li>ProductID</li> </ol> <p><code>**now**</code> There is a trigger which runs after BillDetails Insertion, whose function is to deduct quantity from SubProductAtLocation, further more there are triggers after insert, update in subproductAtLocation, which writes Auditing log.</p> <p><code>**Problem**</code> I would not want subproductAtLocation triggers to run if its called due to update done by billdetails trigger, usually I can disable triggers temporarily or can <code>sp_configure 'nested triggers' n</code> but can not do this as sql server is shared and doing this is nor feasible neither permitted. </p> <pre><code>**Possible Solution** </code></pre> <p>If I can store a flag value some where which is check by subproductatLocation Triggers and can rollback transaction if flag is set. This flag can be cleared in last line of BillDetails Trigger.</p> <p>Kindly pardon my poor knowledge Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload