- CREATE TRIGGER trigg_insert ON change FOR INSERT
- AS
- begin
- declare @count int
- --select @count =count(*) from change
- select 1 from change
- set @count=@@rowcount
- if (@count >5)
- begin
- delete from change where id in (select top 1 id from change order by id asc )
- end
- end
待优化....