Hi everyone,
This 2005 database is in Simple recovery and I need to delete approx 1 million rows from a table.
The max size for the trans log is set to 5 GB and I cannot increase it becasue no more space is available on the drive.
I shrink the log down to 50 MB and run this block of code. After 25 mins the log is full (5 GB) but no records have been deleted.
Note: there are 15 indexes on this table - is that a factor? Should I drop indexes before running the Delete?
declare @curDate datetime
Set @curDate = getDate()
delete from dbo.events
where Datediff(day, EVENT_DATE, @curDate) > 150;
Thanks, john
This 2005 database is in Simple recovery and I need to delete approx 1 million rows from a table.
The max size for the trans log is set to 5 GB and I cannot increase it becasue no more space is available on the drive.
I shrink the log down to 50 MB and run this block of code. After 25 mins the log is full (5 GB) but no records have been deleted.
Note: there are 15 indexes on this table - is that a factor? Should I drop indexes before running the Delete?
declare @curDate datetime
Set @curDate = getDate()
delete from dbo.events
where Datediff(day, EVENT_DATE, @curDate) > 150;
Thanks, john