Best approach to delete large table with foreign key constraints How to purge a table with a billion records that has foreign key to another table? Should one partition the table and the child table and use partition swap?
Try this:


Insert 3 month data in new table with similar structure:



declare @CurDate datetime
select * 
into NewTable
from ExistingTable 
where datecol &gt;= @CurDate and datecol &lt;= dateadd(month,3,@CurDate)




Rename old table to anything unique or drop table as per requirement
Rename new table to existintg table
Insert into NewChildTable with similar structure which match New parent table of Step 3
Rename or drop existing child table
Rename new child table to existing child table