I have a few SQL Server 2005 databases in simple recovery mode. The disk volume in which my transaction logs are stored had only 1GB free, when I started a stored procedure (massive delete in a single table) the log grows a lot and the disk is running out of space, and the stored procedure seems to work indefinetly. How can I manage this transaction log?
Asked
Active
Viewed 199 times
1 Answers
4
You have two choices:
Break the delete into chunks, as Jonathan explained and as I blogged about here:
Give the transaction log more space to grow to accommodate the log activity (and don't shrink it after every delete; all this does is make the next delete take longer). If you run a delete command that deletes 100K rows, the log has to be able to record all of that activity, regardless of recovery model.
For a much more thorough treatment of the subject, see:
Aaron Bertrand
- 181,950
- 28
- 405
- 624