How to Insert a particular Number of Records/ rows in a table


write the following trigger in your sqlserver 2008

create trigger LimitTable

on student
after insert
as
    declare @tableCount int
    select @tableCount = Count(*)
    from student
    if @tableCount >15
    begin
        rollback
    end
go


Here Student is the Table Name and LimitTable is the Trigger Name....




0 comments:

Post a Comment