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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 Clustered index

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-06-07 : 12:07:33
David writes "I have a table that has 3 Million records which is 28 months of data. I would like to keep only 18 months of data. What is the best way to handle this? Delete 10 months or to create a view so that the user only sees 18 months. The table uses clustered indexes"

X002548
Not Just a Number

15586 Posts

Posted - 2004-06-07 : 12:11:29
Well not really...the tables uses 1 clustered index....

What is the table used for?

Maybe create a history table populate it and then create a view..and have a nightly process that rolls the records off current....



Brett

8-)
Go to Top of Page

SamC
White Water Yakist

3467 Posts

Posted - 2004-06-07 : 13:00:00
Sounds like historic data, with nothing new going in? Delete the stuff you don't need.

If it's dynamic, with new stuff going in every day, a VIEW would be fine, but I like to code the query so I can see what's happening.

SELECT ColA, ColB 
From Mytable
Where DATEDIFF(mm, CreateDateCol, GETDATE()) <= 18
Sam
Go to Top of Page
   

- Advertisement -