--自定义字段5 显示第一次的制单人员 CREATE TRIGGER [dbo].[tri_xsckzdr] ON [dbo].[comBillAccounts] AFTER insert AS IF UPDATE(FundBillNo) BEGIN if exists (select * from inserted where Flag=502) begin update a set a.Udef5=b.MakerID from comBillAccounts a join inserted b on a.FundBillNo=b.FundBillNo and a.Flag=b.Flag where a.Flag=502 and a.Udef5='' end END