现在有一个表,有五个字段。
- SQL code
CREATE TABLE [dbo].[Business_Book_Detail_TMP]( [id] [bigint] IDENTITY(1,1) NOT NULL, [mobile] [bigint] NOT NULL, [bizcode] [varchar](50) NULL, [saledate] [datetime] NULL, [usermobile] [varchar](20) NULL, CONSTRAINT [PK_Business_Book_Detail_TMP] PRIMARY KEY NONCLUSTERED ( [id] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY])
然后 还取模[mobile]这个字段创建分区表。
没弄过分区表 求助各位了。
------解决方案--------------------
- SQL code
CREATE PARTITION FUNCTION myRangePF1 (int)AS RANGE LEFT FOR VALUES (1, 100, 1000) ;GOCREATE PARTITION SCHEME myRangePS1AS PARTITION myRangePF1TO (test1fg, test2fg, test3fg, test4fg) ; --数据库文件组没有时全指定为主文件组[PRIMARY]GOCREATE TABLE [dbo].[Business_Book_Detail_TMP]( [id] [bigint] IDENTITY(1,1) NOT NULL, [mobile] [bigint] NOT NULL, [bizcode] [varchar](50) NULL, [saledate] [datetime] NULL, [usermobile] [varchar](20) NULL, CONSTRAINT [PK_Business_Book_Detail_TMP] PRIMARY KEY NONCLUSTERED ( [id] ASC)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON myRangePS1 ([id]))
------解决方案--------------------
http://blog.csdn.net/bg1jt/article/details/2070884