日期:2014-05-18  浏览次数:20544 次

SQL高手请帮我解决
我想在一张表里增加一条记录时把这条记录的主键(ID)赋给另一个字段(也是个id);
请问高手能实现吗,怎样实现呢?
谢谢

------解决方案--------------------
create trigger tr_tb1_i on tb1 for insert
as
update tb1 set col2 = Inserted.ID from tb1,Inserted where tb1.ID = Inserted.ID