sql server - Trigger of Batch Update -
i have 3 tables , trigger in purchase table.
user (userid | balance)
purchase (purchaseid | userid | amount | isconfirm)
transactiondetail (trxid | userid | balance |amount)
when purchase isconfirm updated false true, want trigger update player balance , insert new record(s) transactiondetail.
i have bulk update statement:
update purchase set isconfirm = true userid=1
i know trigger fired once batch update. if there 5 rows updated, there 1 row inserted transactiondetail table, , balance not updated correctly.
if there 5 rows affected in batch update,
using trigger, there way insert 5 updated rows transactiondetail , update user balance correctly?
Comments
Post a Comment