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

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -