learn about sqlserver partitition and partition table --- add or remove table partitions addition more
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的更多相关文章
- 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 ...
- 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. ...
- 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 ...
- 实战:sqlserver 2008 扩展事件-XML转换为标准的table格式
--假设已经存在Event Session删除 IF EXISTS (SELECT * FROM sys.server_event_sessions WHERE name='MonitorLongQu ...
- 【待整理】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 ...
- faster alter table add column
Create a new table (using the structure of the current table) with the new column(s) included. execu ...
- 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 ...
- 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 ...
- refresh table tablename ;MSCK REPAIR TABLE table_name;
在更改分区内的文件后刷新表 refresh table tablename ; 我们平时通常是通过alter table add partition方式增加Hive的分区的,但有时候会通过HDFS p ...
随机推荐
- 前端Tips#3 - 简写的 border-radius 100% 和 50% 是等效的
本文同步自 JSCON简时空 - 技术博客,点击阅读 视频讲解 视频地址 文字讲解 1.先讲结论 border-radius 这个 css 属性大家应该使用得非常娴熟,现实中用到的场景基本都是四个圆角 ...
- Python学到什么程度可以面试工作(解答一)
本文整理了 26 个 Python 有用的技巧,将按照首字母从 A~Z 的顺序分享其中一些内容. all 或 any 人们经常开玩笑说 Python 是“可执行的伪代码”,但是当你可以这样编写代码时, ...
- 【转】线性插值(Linear Interpolation)基本原理
转:https://blog.csdn.net/u010312937/article/details/82055431 今天在阅读大牛代码的时候,发现了Linear Interpolation一次,百 ...
- 【Springboot】注解@ConfigurationProperties让配置整齐而简单
1 简介 前面我们用一篇文章<[Spring]只想用一篇文章记录@Value的使用,不想再找其它了(附思维导图)> 详细讲解了在Spring中如何使用@Value来实现我们对配置的需求,它 ...
- 解决elment 动态多选框组(el-checkbox-group)无法设置默认值问题
<el-checkbox-group v-model="form.showProperty"> <el-checkbox v-for="(item,id ...
- Spring中使用注解 @Scheduled执行定时任务
注解@Scheduled 使用方式 注解@Scheduled 可以作为一个触发源添加到一个方法中,例如,以下的方法将以一个固定延迟时间5秒钟调用一次执行,这个周期是以上一个调用任务的完成时间为基准,在 ...
- Deferred shading rendering path翻译
Overview 概述 When using deferred shading, there is no limit on the number of lights that can affect a ...
- python 作用域,global与nonlocal的区别
在Python中并不是所有的语句块中都会产生作用域.只有当变量在Module(模块).Class(类).def(函数)中定义的时候,才会有作用域的概念. 如果在函数中要对全局变量做改变可以使用glob ...
- isStatic:检测数据是不是除了symbol外的原始数据
function isStatic(value) { return( typeof value === 'string' || typeof value === 'number' || typeof ...
- git查看远程仓库和本地的区别
git diff 你可以用 git diff 来比较项目中任意两个版本的差异. $ git diff master..test 上面这条命令只显示两个分支间的差异,如果你想找出 master , te ...