Create an AFTER INSERT
trigger on the table. Here's something that would be relatively effective with your requirement:
create trigger LimitTable
on YourTableToLimit
after insert
as
declare @tableCount int
select @tableCount = Count(*)
from YourTableToLimit
if @tableCount > 50
begin
rollback
end
go
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…