我想从表中删除所有用户数据并插入新的。多个任务可以同时执行此操作。
可密封隔离级别是否合适?
SET TRANSACTION ISOLATION LEVEL Serializable;
BEGIN TRANSACTION;
delete from table where userId = 1
insert into table (userid, somethingData) (1,'somethingData 1')
insert into table (userid, somethingData) (1,'somethingData 2')
insert into table (userid, somethingData) (1,'somethingData 3')
COMMIT TRANSACTION;