zoukankan      html  css  js  c++  java
  • sqlserver表分区

    参考:http://www.cnblogs.com/knowledgesea/p/3696912.html

    及百度搜索sqlserver表分区

    create partition 
    function sgy_partitionfun (int) as range left for values(N'10000', N'20000')
    
    //drop partition function sgy_partitionfun
    
    
    
    BEGIN TRANSACTION
    
    
    --创建分区方案
    CREATE PARTITION SCHEME [bgPartitionSchema] AS PARTITION sgy_partitionfun TO ([PRIMARY], filegroup1, filegroup2)
    
    --创建分区索引
    CREATE CLUSTERED INDEX [ClusteredIndex_on_bgPartitionSchema_635342971076448165] ON gms_item
    (
        gameserverid
    )WITH (SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF) ON [bgPartitionSchema](gameserverid)
    
    --删除分区索引
    DROP INDEX [ClusteredIndex_on_bgPartitionSchema_635342971076448165] ON gms_item WITH ( ONLINE = OFF )
    
    COMMIT TRANSACTION
    
    select * from gms_item where $partition.sgy_partitionfun(gameserverid)=1
    

      

  • 相关阅读:
    python条件判断之直接加数字
    pythontip题目解答
    twitter api取出的日期格式化
    MySQL Archive存储引擎
    Python Json序列化
    Python 装饰器
    Python 匿名函数
    Python 函数
    Python 字符编码
    Python 文件操作
  • 原文地址:https://www.cnblogs.com/barrysgy/p/4748540.html
Copyright © 2011-2022 走看看