日期:2014-05-17 浏览次数:20488 次
ALTER DATABASE opcdatabase ADD FILEGROUP [2014_01_21_13_00_00];
ALTER DATABASE opcdatabase add file (name = '2014_01_21_13_00_00', filename = 'c:\2014_01_21\2014_01_21_13_00_00.ndf') TO filegroup [2014_01_21_13_00_00];
ALTER DATABASE opcdatabase MODIFY FILEGROUP [2014_01_21_13_00_00] DEFAULT;
ALTER DATABASE opcdatabase ADD FILEGROUP [p0];
ALTER DATABASE opcdatabase add file (name = 'p0', filename = 'c:\p0.ndf') TO filegroup [p0];
create partition function DivideItemData(datetime) as range right for values('2014-01-21 14:00:00');
CREATE PARTITION SCHEME SchemeItemData AS PARTITION DivideItemData TO ('2014_01_21_13_00_00', 'p0');
create table opc_itemdata(ITEMID nvarchar(50) NOT NULL,QUALITY int NOT NULL,VALUE decimal(18, 2) NOT NULL,TIMESTP datetime NOT NULL,constraint PK_opc_itemdata primary key(ITEMID,TIMESTP)) ON SchemeItemData (TIMESTP);
alter partition scheme SchemeItemData next used [2014_01_21_13_00_00];
ALTER DATABASE opcdatabase ADD FILEGROUP [2014_01_21_14_00_00];
ALTER DATABASE opcdatabase add file (name = '2014_01_21_14_00_00', filename = 'c:\2014_01_21\2014_01_21_14_00_00.ndf') TO filegroup [2014_01_21_14_00_00];
ALTER DATABASE opcdatabase MODIFY FILEGROUP [2014_01_21_14_00_00] DEFAULT;
alter partition function DivideItemData() split range ('2014-01-21 15:00:00');
alter partition scheme SchemeItemData next used [2014_01_21_14_00_00];