How to make Trigger auto delete Column if stock Qty 0?AHAmrul Hakim9yAsked May 21, 2017, 8:28 AM901 This My Table Stock:
Nilesh Shah9y agoPosted May 21, 2017, 5:50 PMAccepted answerhere is an example you may have to change according to your table:CREATE TRIGGER trg_Update_Qty ON Stock AFTER UPDATE AS UPDATE Stock SET Keterangag = 0 FROM inserted WHERE inserted.qty = 0 and inserted.kode_barang = Stock.kode_barang GO please mark the answer as accepted if it satisfies your question
Nilesh Shah9y agoPosted May 21, 2017, 3:36 PMI assume you want to delete the data in the last column from table when qty = 0. write a trigger on that table in check if qty=0, then delete data in last column i.e. set it to 0
Nilesh ShahPosted May 21, 2017, 5:50 PM
Amrul HakimPosted May 21, 2017, 4:42 PM
Nilesh ShahPosted May 21, 2017, 3:36 PM