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
 General SQL Server Forums
 Script Library
 Table partitioning

Author  Topic 

youngb912
Starting Member

14 Posts

Posted - 2010-06-17 : 21:02:06
I need to partition an existing table as below. The table name is sales_log. Here is what I'm doing so far

CREATE PARTITION FUNCTION MyPartitionRange (Date)
AS RANGE LEFT FOR VALUES (1)

Partition 1 – Partition value <= 20 days
Partition 2 – Partition value > 20 days

CREATE PARTITION SCHEME MyPartitionScheme AS
PARTITION MyPartitionRange
ALL TO ([PRIMARY])

I copied the above from a site as my template. Now I want to partition an existing table (Saleslog) so that data less than 20days remain on partition1 and those older than 20 goes to partition two. How do I get this to work?
   

- Advertisement -