Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个设置表 'SettingTab'和一个数字列 ' nSlNo (int)' 来生成两个表'Tab1'和'Tab2' 的主键。当两个表同时访问设置表时,如何实现这一点而不会发生任何数字冲突。
我使用了 SQL 范围或 Begin-Commit Transaction。当我开始访问 Setting table 时,向 Setting table 发送了一个更新命令。所以表被锁定直到Commit。通过这种方式,我避免了冲突。