create trigger tgr_nameon 表a for insertasdeclare @id select @id=id from insertedupdate 表bset State=0where State=1 and id=@id