34,576
社区成员
发帖
与我相关
我的任务
分享
-- Step 1
Create partition function pf_year (data type) as range left for values ('2007-12/31', '2008-12-31')
-- Step 2
Create partition scheme ps_year as partition pf_year to (FG1, FG2, FG3)
-- Step 3
alter table mytable drop constraint pk_key with (move to ps_year(date_column))
-- Step 4
alter table mytable add constraint pk_key primary key clustered(id,date_column)