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.
谁能告诉我如何在将记录插入数据库时更新它的列。这是我想要的伪代码。
if( mytable.OriginalId == null ) mytable.OriginalId = Scope_Identity();
我认为这将是矛盾的。OriginalId 已设置或未插入。
如果不是从哪里Scope_Identity()获得它的价值?如果它来自另一列,那么使用计算列不是更好吗?
Scope_Identity()
抱歉,目前尚不清楚总体目标是什么……您通常不会使用触发器,特别是如果 OriginalId 是 PK 的一部分