Setup a Trigger on Table to limit the number of INSERT, DELETE, UPDATE Operations
问题 For example : A user should not be able to perform INSERT , DELETE and UPDATE operations more than X number of times on a particular table at a given point of time, if the user performs an operation X +1 times than a trigger will be launched. 回答1: create table dbo.targetTable ( id int, colA varchar(10) ); go create or alter trigger dbo.DMLxTimes on dbo.targetTable for insert, update, delete as begin /* --old days.. IF @@ROWCOUNT > 5 begin rollback; end --*/ declare @maxrows int = 5; --maximum