1
2 |
sp_help t_jingyu go |
1
2
3
4
5
6 |
sp_rename t_jingyu,t_jingyu_bak go sp_rename "t_jingyu_bak.pk_t_jingyu" ,pk_t_jingyu_bak go sp_rename "t_jingyu_bak.idx_t_jingyu_1" ,idx_t_jingyu_1_bak go |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39 |
CREATE TABLE dbo.t_jingyu ( oid varchar (64) NOT
NULL , related_rnc varchar (64) NULL , start_time datetime NOT
NULL ) LOCK DATAROWS PARTITION BY
RANGE (start_time) (p20140601 VALUES
<= ( ‘2014-06-01 23:59:59.999‘ ) ON
seg_d_wrnop, p20140602 VALUES
<= ( ‘2014-06-02 23:59:59.999‘ ) ON
seg_d_wrnop, p20140603 VALUES
<= ( ‘2014-06-03 23:59:59.999‘ ) ON
seg_d_wrnop, p20140604 VALUES
<= ( ‘2014-06-04 23:59:59.999‘ ) ON
seg_d_wrnop, p20140605 VALUES
<= ( ‘2014-06-05 23:59:59.999‘ ) ON
seg_d_wrnop, p20140606 VALUES
<= ( ‘2014-06-06 23:59:59.999‘ ) ON
seg_d_wrnop, p20140607 VALUES
<= ( ‘2014-06-07 23:59:59.999‘ ) ON
seg_d_wrnop, p20140608 VALUES
<= ( ‘2014-06-08 23:59:59.999‘ ) ON
seg_d_wrnop, p20140609 VALUES
<= ( ‘2014-06-09 23:59:59.999‘ ) ON
seg_d_wrnop, p20140610 VALUES
<= ( ‘2014-06-10 23:59:59.999‘ ) ON
seg_d_wrnop, p20140611 VALUES
<= ( ‘2014-06-11 23:59:59.999‘ ) ON
seg_d_wrnop, p20140612 VALUES
<= ( ‘2014-06-12 23:59:59.999‘ ) ON
seg_d_wrnop, p20140613 VALUES
<= ( ‘2014-06-13 23:59:59.999‘ ) ON
seg_d_wrnop, p20140614 VALUES
<= ( ‘2014-06-14 23:59:59.999‘ ) ON
seg_d_wrnop, p20140615 VALUES
<= ( ‘2014-06-15 23:59:59.999‘ ) ON
seg_d_wrnop, p20140616 VALUES
<= ( ‘2014-06-16 23:59:59.999‘ ) ON
seg_d_wrnop, p20140617 VALUES
<= ( ‘2014-06-17 23:59:59.999‘ ) ON
seg_d_wrnop, p20140618 VALUES
<= ( ‘2014-06-18 23:59:59.999‘ ) ON
seg_d_wrnop, p20140619 VALUES
<= ( ‘2014-06-19 23:59:59.999‘ ) ON
seg_d_wrnop, p20140620 VALUES
<= ( ‘2014-06-20 23:59:59.999‘ ) ON
seg_d_wrnop, p20140621 VALUES
<= ( ‘2014-06-21 23:59:59.999‘ ) ON
seg_d_wrnop, p20140622 VALUES
<= ( ‘2014-06-22 23:59:59.999‘ ) ON
seg_d_wrnop, p20140623 VALUES
<= ( ‘2014-06-23 23:59:59.999‘ ) ON
seg_d_wrnop, p20140624 VALUES
<= ( ‘2014-06-24 23:59:59.999‘ ) ON
seg_d_wrnop, p20140625 VALUES
<= ( ‘2014-06-25 23:59:59.999‘ ) ON
seg_d_wrnop, p20140626 VALUES
<= ( ‘2014-06-26 23:59:59.999‘ ) ON
seg_d_wrnop, p20140627 VALUES
<= ( ‘2014-06-27 23:59:59.999‘ ) ON
seg_d_wrnop, p20140628 VALUES
<= ( ‘2014-06-28 23:59:59.999‘ ) ON
seg_d_wrnop, p20140629 VALUES
<= ( ‘2014-06-29 23:59:59.999‘ ) ON
seg_d_wrnop, p20140630 VALUES
<= ( ‘2014-06-30 23:59:59.999‘ ) ON
seg_d_wrnop) go |
1
2
3
4
5 |
CREATE UNIQUE NONCLUSTERED INDEX
pk_t_jingyu ON
dbo.t_jingyu(oid,start_time) ON
seg_i_wrnop LOCAL INDEX go |
1
2
3
4
5 |
CREATE NONCLUSTERED INDEX
idx_t_jingyu_1 ON
dbo.t_jingyu(start_time,related_rnc) ON
seg_i_wrnop LOCAL INDEX go |
1
2 |
insert into t_jingyu select
* from t_jingyu_bak where
条件 go |
Sybase数据库,普通表修改分区表步骤,布布扣,bubuko.com
原文地址:http://www.cnblogs.com/jyzhao/p/3768741.html