日期:2014-05-18 浏览次数:20437 次
create trigger tt on tb for insert begin if (select count(*) from tb)>100000 delete tb where id<1000 end
------解决方案--------------------
--删除全部啊
create trigger tt on tb for insert begin if (select count(*) from tb)>100000 truncate table tb end
------解决方案--------------------
create trigger tt on tb for insert begin while(@@rowcount>=10) truncate table tb end