SQL Server ->> 分区表上创建唯一分区索引
                        
                            时间:2021-07-01 10:21:17
                            帮助过:3人阅读
							                        
                     
                    
                    
                     partition 
function PF_One_Fifty_OneHundred(
INT)
AS RANGE 
LEFT FOR VALUES(
1,
50,
100)
GO
CREATE PARTITION SCHEME PS_One_Fifty_OneHundred
AS PARTITION PF_One_Fifty_OneHundred
TO (
[PRIMARY], 
[PRIMARY], 
[PRIMARY], 
[PRIMARY]);
GO
--DROP TABLE  dbo.partition_test
create table dbo.partition_test
(
    col1 INT    ,
    col2 INT
) ON PS_One_Fifty_OneHundred(col1)
GO
CREATE UNIQUE INDEX UIX_partition_test_col1 
ON dbo.partition_test(col1) 
ON PS_One_Fifty_OneHundred(col2);
Msg 1913, 
Level 16, State 
1, Line 
35
The operation failed because an index or statistics with name 
‘UIX_partition_test_col1‘ already 
exists on table ‘dbo.partition_test‘.
 
SQL Server ->> 分区表上创建唯一分区索引
标签: