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. Spring注解:InitBinder

    注解 InitBinder 是用来初始化绑定器Binder的,而Binder是用来绑定数据的,换句话说就是将请求参数转成数据对象. @InitBinder用于在@Controller中标注于方法,表示 ...

  2. floj 2264

    2.公路建设(highway.c/cpp/pas) 在滨海市一共有n 个城市,编号依次为1到n,它们之间计划修建m条双向道路,其中修建第i条道路的费用为ci. 海霸王作为滨海市公路建设项目的总工程师, ...

  3. 两个关于 Java 面试的 Github 项目

    哈喽,大家好.相信大家都知道金九银十,在人才市场上是指每年的 9 月和 10 月是企业的招聘高峰期.这个时候企业往往有大量招聘需求,求职者在这个时候就找工作无疑是最适合的.需求大,谈工资什么的就更容易 ...

  4. cogs 495. 滑动窗口 单调队列

    495. 滑动窗口 ★★   输入文件:window.in   输出文件:window.out   简单对比时间限制:2 s   内存限制:256 MB [问题描述] 给你一个长度为N的数组,一个长为 ...

  5. vs推送git失败,修改git下config的Log

    一开始写完程序套推送到Git中,然后就来了一下,下面的异常: 异常1 发布到远程存储库时遇到错误: Git failed with a fatal error. fatal: HttpRequestE ...

  6. kubernetes concepts -- Pod Overview

    This page provides an overview of Pod, the smallest deployable object in the Kubernetes object model ...

  7. 洛谷 P5424 [USACO19OPEN]Snakes

    题目链接 题目描述 传说,数千年前圣帕特里克消灭了哞尔兰所有的蛇.然而,蛇们现在卷土重来了!圣帕特里克节是在每年的3月17日,所以Bessie要用彻底清除哞尔兰所有的蛇来纪念圣帕特里克. Bessie ...

  8. Django AJAX csrf

    1.原始 a.在HTML中添加 {% csrf_token %} b.在data中添加csrf_token对应input的 键值对 "csrfmiddlewaretoken" : ...

  9. Qt Installer Framework翻译(1)

    IFW概览 Qt Installer Framework 提供了一组工具和程序来创建安装程序,并在不重写源代码的情况下将它们部署到所有受支持的桌面 Qt 平台上.安装程序具有本地化外观,并且可以感知运 ...

  10. Jenkins-k8s-helm-harbor-githab-mysql-nfs微服务发布平台实战

    基于 K8S 构建 Jenkins 微服务发布平台 实现汇总: 发布流程设计讲解 准备基础环境 K8s环境(部署Ingress Controller,CoreDNS,Calico/Flannel) 部 ...