0

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
2
  • 3
    Can you post the trigger code?
    – McNets
    Jul 2, 2020 at 7:08
  • This was the trigger: 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 Oct 4, 2020 at 18:55

1 Answer 1

6

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.

1
  • OMG, You are right! I forgot about that trigger. Thank you! Jul 3, 2020 at 8:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.