The transaction log for database is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases

前端 未结 3 787
刺人心
刺人心 2021-02-01 16:47

I am getting following error while I am trying to delete 355447 records in single delete query.

The transaction log for database is full. To find out why space in the lo

3条回答
  •  北海茫月
    2021-02-01 17:17

    As an aside, it is always a good practice (and possibly a solution for this type of issue) to delete a large number of rows by using batches:

    WHILE EXISTS (SELECT 1 
                  FROM   YourTable 
                  WHERE  ) 
      DELETE TOP(10000) FROM YourTable 
      WHERE  
    

提交回复
热议问题