在每日工作计划的某一天,我收到错误 The transaction log for database dbname is full due to 'ACTIVE_TRANSACTION'

On a certain day in the daily job schedule i get the error The transaction log for database dbname is full due to 'ACTIVE_TRANSACTION'

我有一个每天都可以正常执行的批处理作业,但是从周五晚上运行到周六早上的作业出现以下错误:

The transaction log for database 'Db name' is full due to 'ACTIVE_TRANSACTION' and fails execution.

你能帮我理解这个问题吗?

尝试小批量删除数据,而不是单个事务。

While (@RecordCount > 0)
  BEGIN
       DELETE top 5000 FROM <<TABLE>>
       <<where condition>>
     SET @RecordCount = @@RowCount
  END