Sql-server – “To many rows being processed at one. Reduce and try again.” error in SQL Server Management Studio

sql servert-sqltrigger

I get this error when trying to update some rows from SQL Server Management Studio v18.5:

Msg 50000, Level 16, State 1, Procedure UPDATElimit, Line 7 [Batch
Start Line 0] To many rows being processed at one. Reduce and try
again. Msg 3609, Level 16, State 1, Line 1 The transaction ended in
the trigger. The batch has been aborted.

How can I bypass this limitation?

Trigger code:

ALTER TRIGGER [dbo].[UPDATElimit] 
on [dbo].[table] 
FOR UPDATE 
AS 
BEGIN 
    IF (select count(*) from inserted) > 1000 
    BEGIN 
        RAISERROR('To many rows being processed at one. Reduce and try again.', 16, 1) 
        ROLLBACK 
    END 
END

Best Answer

To clarify on @McNets comment: The error isn't produced by SQL Server itself. Somebody created a trigger on the table, a trigger that fires on UPDATE. This trigger apparently does a check for number of rows and if above a certain threshold, it generates this error and does a rollback.

You should try to find who is responsible for the trigger and take it from there. Perhaps it is OK to do an exception to that trigger rule in this particular case? Etc.