Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
bobanjayan
Yak Posting Veteran
67 Posts |
Posted - 2004-06-22 : 05:55:53
|
| Hi all,I have a problem when deleting 3 Cr. rows from a table.The log files grow to the total disk space.Database recovery mode is simple.Why is behaves like this?I cannot use "truncate" because delete has a "where" clause.I had made a job and schedule for night. It failed because the transaction log was full.Any idea? |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2004-06-22 : 06:32:17
|
| The delete is adding entries to the rt log which cnnot be cleared unti it completes.You need to do the delete in batches. It's better if you can loop through some indexed field but if not something likeset rowcount 10000select 1while @@rowcount > 0delete tble where ....This will delete in batches and allow the tr log to be truncated.==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
|
|
|