October 20, 2010 at 9:41 pm
I have two tables one contains @300 millions records & the other contains @ 500 millions of record.I want to create two stored Procedure that will delete records older than 90 days.Also will need to remove errors from error table for any records removed in the both table..i appreciate any help to solve this issue..
October 21, 2010 at 12:59 am
div4u22 (10/20/2010)
I have two tables one contains @300 millions records & the other contains @ 500 millions of record.I want to create two stored Procedure that will delete records older than 90 days. i appreciate any help to solve this issue..
Why do you want 2 Store procedures to delete, it cant be deleted in single sp ?
Also will need to remove errors from error table for any records removed in the both table
Delete from Error_table As er join Mydata_table1 as my where er.Commonid = my.Commonid
and my.Datefield< Convert(Varchar,GETDATE()-90,101)
Delete from Error_table As er join Mydata_table2 as my where er.Commonid = my.Commonid
and my.Datefield< Convert(Varchar,GETDATE()-90,101)
that will delete records older than 90 days.
Delete from Mydata_table1 Where Datefield< Convert(Varchar,GETDATE()-90,101)
Delete from Mydata_table2 Where Datefield< Convert(Varchar,GETDATE()-90,101)
Thanks
Parthi
October 21, 2010 at 4:33 am
Could you please post your table structure and some sample data so we could verify the advice we're giving you before we give it? It's hard to help you when we don't know what you're working off of.
Also, what have you tried before this?
July 16, 2015 at 7:25 am
I would like to delete records from all tables which is older than 90 days. I know that stored procedure can perform this task. But is there a easy way in Management studio to cleanup data on a periodic basis using maintenance plans at the object level.
Thanks
July 16, 2015 at 7:29 am
Please post this as a new question to the forum. Most people won't read an old thread.
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply