Yes . In the previous. chapter , we see how to generate "partition function" "parttiton schema" and "parttiton table"

what can we do if we need to add or drop an table partition ?

Here is exist status:

/* add partition (oracle)== split partition (oracle,mssql) */
/* drop parttiton (oracle) == merge partition (mssql) */

and

Here we go

/* add partitions */

alter database test add filegroup TESTFG_201602;
alter database test add file (name = TESTFG_201602,filename = "C:\var\opt\mssql\data\TESTFG_201602.ndf",size = 1MB,maxsize = unlimited,filegrowth = 1MB) to filegroup TESTFG_201602;
go
alter partition scheme PS_DATETIME_M_TEST NEXT USED TESTFG_201601;
alter partition function PF_DATETIME_M_TEST() split range ( N'2016-01-02T00:00:00.000');
go

That script has an error. you would see if I execute it

However,  It is right about "less than", because we use range right    --- it will be talk about it in detail

Let get into bussiness, hot to fix that ?

Yes, we merge it

/* drop partitions */
alter partition function PF_DATETIME_M_TEST() merge range (N'2016-01-02T00:00:00.000');
--alter database test remove file TESTFG_201602;
--alter database test remove filegroup TESTFG_201602;

then we can see that return

and we can make it right

alter partition scheme PS_DATETIME_M_TEST NEXT USED TESTFG_201602;
alter partition function PF_DATETIME_M_TEST() split range ( N'2016-02-01T00:00:00.000');
go

Yes. we did it

learn about sqlserver partitition and partition table --- add or remove table partitions addition more的更多相关文章

  1. learn about sqlserver partitition and partition table --- add or remove table partitions

    demo/* add partitions */ alter database xxx add filegroup FG_=fff_201708;alter database xxx add file ...

  2. learn about sqlserver partitition and partition table 1

    Dear all, Let get into business, the partitions on sql server is very different with that on oracle. ...

  3. sqlserver partitition and partition table --- partition show

    I can not believe that I had done this about two years Now we know there is totally different betwee ...

  4. 实战:sqlserver 2008 扩展事件-XML转换为标准的table格式

    --假设已经存在Event Session删除 IF EXISTS (SELECT * FROM sys.server_event_sessions WHERE name='MonitorLongQu ...

  5. 【待整理】MySQL alter table modify vs alter table add产生state不一样

    MySQL:5.6.35 OS:redhat5.8 今天更新数据库某些表字段,有如下两SQL: ①alter table xx modify xxxx;(表大概是77w) ②alter table s ...

  6. faster alter table add column

    Create a new table (using the structure of the current table) with the new column(s) included. execu ...

  7. How to add EDT relation table[AX2012]

    setp 1. First create New Edit. setp 2.Create New Table First Table Name is NParentRel then drag and ...

  8. How to Remove Table Partitioning in SQL Server

    In this article we will see how we can remove partitions from a table in a database in SQL server. I ...

  9. refresh table tablename ;MSCK REPAIR TABLE table_name;

    在更改分区内的文件后刷新表 refresh table tablename ; 我们平时通常是通过alter table add partition方式增加Hive的分区的,但有时候会通过HDFS p ...

随机推荐

  1. K8s 实践 | 如何解决多租户集群的安全隔离问题?

    作者 | 匡大虎  阿里巴巴技术专家 导读:如何解决多租户集群的安全隔离问题是企业上云的一个关键问题,本文主要介绍 Kubernetes 多租户集群的基本概念和常见应用形态,以及在企业内部共享集群的业 ...

  2. 深入理解vue的watch

    深入理解vue的watch vue中的wactch可以监听到data的变化,执行定义的回调,在某些场景是很有用的,本文将深入源码揭开watch额面纱 前言 watch的使用 watch的多种使用方式 ...

  3. 使用docker增加部署速度的一次实践

    问题: 公司给我们分配的服务器到期后不付费了,换成新服务商的服务器了.也就是说我们之前的环境需要重新搭建一次.光项目就50多个(微服务40+,其他服务不到10个),需要重新部署. 之前部署项目时,需要 ...

  4. 微信小程序点击图片放大

    WXML: <view class='imgList'> <view class='imgList-li' wx:for='{{imgArr}}'> <image cla ...

  5. 怎么将文件夹上传到GitHub上

    1. 在GitHub上新建一个仓库地址: http://github.com/......git 2. 在需要上传的文件夹目录下,运行 git   init  初始化git: 3. 运行git  ad ...

  6. 原生JS在网页上复制的所有文字后面自动加上一段版权声明

    不少技术博客有这样的处理,当我们复制代码的时候,会自动加上一段本信息版权为XXXX,这是怎么实现的呢? 其实实现的方式很简单,可以在我的网站页面上绑定一个copy事件,当你复制文章内容的时候,自动在剪 ...

  7. Python Global和Nonlocal的用法

    nonlocal 和 global 也很容易混淆.简单记录下自己的理解. 解释 global 总之一句话,作用域是全局的,就是会修改这个变量对应地址的值. global 语句是一个声明,它适用于整个当 ...

  8. elasticjob学习一:simplejob初识和springboot整合

    Elastic-Job是一个分布式调度解决方案,由两个相互独立的子项目Elastic-Job-Lite和Elastic-Job-Cloud组成. Elastic-Job-Lite定位为轻量级无中心化解 ...

  9. maven报错:Return code is: 501 , ReasonPhrase:HTTPS Required

    今天把一个去年没做完的项目翻出来做时,发现maven无法正常导入依赖.检查了一遍项目配置,没发现有什么问题.而且依赖在本地仓库存在. 随后发现报错:Failed to transfer file:** ...

  10. 嵩天老师python网课爬虫实例1的问题和解决方法

    一,AttributeError: 'NoneType' object has no attribute 'children', 网页'tbody'没有子类 很明显,报错的意思是说tbody下面没有c ...