「記事のディレクトリのWindowsのAzureのプラットフォームシリーズ」
昨日、顧客は今、それを記録し、それを述べました。
私たちは、表のパーティションを使用し、従来のSQL Serverを使用している、この機能のAzure SQLデータベースの雲が達成可能です。
1.まず、我々は少しデータベースのAzure SQLデータベース、プロセスを作成
2. SQL Server Management Studioをリンク
3.次のTSQLを実行します
- 表の作成 CREATE TABLEを [ DBO ]。[ FactInternetSales ] ( [ のProductKey ] int型 NULL 、 [ OrderDateKey ] int型 NULL 、 [ CustomerKey ] int型 NULL 、 [ PromotionKey ] int型 NULL 、 [ SalesOrderNumber ] NVARCHAR(20)NULL 、 [ OrderQuantity ] SMALLINT NULL 、 [ 単価] マネー NULL 、 [ SalesAmount ] お金 NULL ) - パーティション関数を作成 CREATE PARTITIONのFUNCTION [ pf_DayOfTheYear ](INTを)AS RANGEのLEFT FOR VALUES (20000101、20010101、20020101 、20030101、20040101、20050101 ) -SQLパーティションスキームの作成 CREATE PARTITIONスキーム[ ps_DayOfTheYear ] AS PARTITION [ pf_DayOfTheYear ] ALL TO([ PRIMARY ] ) - ショーパーティション SELECT ps.name、pf.name、boundary_id、[ 値] FROM PS sys.partition_schemes INNERは 、JOINのsysを。 partition_functions PF ON pf.function_id = ps.function_id INNER JOINを sys.partition_range_values PRF ON pf.function_id =prf.function_id - Patitionを作成 CREATE CLUSTERED INDEX IX_TABLE1_OrderdateKeyをON DBO。[ FactInternetSales ] (OrderDateKey) WITH(STATISTICS_NORECOMPUTE = OFF、IGNORE_DUP_KEY = OFF 、 ALLOW_ROW_LOCKS = ON、ALLOW_PAGE_LOCKS = ON ) ON [ ps_DayOfTheYear ] (OrderDateKey) GO - テスト・データ INSERT INTO [ DBO ]。[FactInternetSales ](OrderDateKey)VALUES(20000101 )。 - 多增加一行 INSERT INTO [ DBO ]。[ FactInternetSales ](OrderDateKey)VALUES(20000101 )。 INSERT INTO [ DBO ]。[ FactInternetSales ](OrderDateKey)VALUES(20010101 )。 INSERT INTO [ DBO ]。[ FactInternetSales ](OrderDateKey)VALUES(20020101 )。 INSERT INTO [ DBO ]。[ FactInternetSales ](OrderDateKey)VALUES(20030101 )。 INSERT INTO [ DBO ]。[ FactInternetSales ](OrderDateKey)VALUES(20040101 )。 INSERT INTO [ DBO ]。[ FactInternetSales ](OrderDateKey)VALUES(20050101 )。 -そのパーティション/行数と------------------------------ SHOWインデックス(一つだけで開始します)----- -------------------------------------------------- ----------------- SELECT o.nameのObjectName、i.nameの索引名、PARTITION_ID、PARTITION_NUMBER、[ 行] - 、F [名前]を'ファイルグループ'、i.data_space_id FROM sys.partitions P INNERは 、JOIN oをsys.objectsをON O。OBJECT_ID = P。OBJECT_ID INNERは 、JOIN sys.indexes I ON私を。OBJECT_ID = P。OBJECT_ID と p.index_id =i.index_id - 左外側はi.data_space_id = f.data_space_id F上sys.filegroupsに参加 WHERE o.name = ' FactInternetSales '