Tuesday, 15 March 2011

sql server - Trigger of Batch Update -


I have 3 tables and a trigger in the purchase table.

User (UserId | Balance)

Purchase (Purchase ID | User Id | Zodiac | Important)

Transaction Deltat (TRUCKID | UserID | Balance | Amount)

When the purchase order is incorrectly updated from True, I want to update the player balance to the trigger and enter new record in the transaction directory.

I have this bulk update statement:

Update Set SET IsConfirm = true WHERE UserId = 1

I know that the trigger only for batch updates Will be removed once. So if 5 rows have been updated, then only 1 row has been entered in the transaction table, and the balance has not been updated properly.

If there are 5 rows affected in a batch update, is there a way to trigger the trigger, insert 5 updated rows into transaction delays and update user balance correctly?


No comments:

Post a Comment