触发器可以参考下面的,不过我感觉可以创建一个外键更好create trigger tr_test_id on testafter update as if not exists (select 1 from t1,inserted where t1.name=inserted.name and t1.id=inserted.id)begin print '不允许修改!' rollback transactionend