惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

WordPress大学
WordPress大学
Microsoft Security Blog
Microsoft Security Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
V
Visual Studio Blog
宝玉的分享
宝玉的分享
IT之家
IT之家
人人都是产品经理
人人都是产品经理
T
The Blog of Author Tim Ferriss
I
InfoQ
B
Blog RSS Feed
T
Threatpost
博客园_首页
M
MIT News - Artificial intelligence
Spread Privacy
Spread Privacy
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
Know Your Adversary
Know Your Adversary
U
Unit 42
Engineering at Meta
Engineering at Meta
C
Cyber Attacks, Cyber Crime and Cyber Security
月光博客
月光博客
Scott Helme
Scott Helme
T
Tor Project blog
有赞技术团队
有赞技术团队
AWS News Blog
AWS News Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Last Week in AI
Last Week in AI
S
Schneier on Security
Vercel News
Vercel News
博客园 - Franky
C
Cybersecurity and Infrastructure Security Agency CISA
L
LINUX DO - 热门话题
NISL@THU
NISL@THU
L
LangChain Blog
爱范儿
爱范儿
Google DeepMind News
Google DeepMind News
The GitHub Blog
The GitHub Blog
雷峰网
雷峰网
Latest news
Latest news
C
CXSECURITY Database RSS Feed - CXSecurity.com
Hugging Face - Blog
Hugging Face - Blog
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
www.infosecurity-magazine.com
www.infosecurity-magazine.com
G
GRAHAM CLULEY
S
Security Affairs
A
About on SuperTechFans
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
大猫的无限游戏
大猫的无限游戏
W
WeLiveSecurity
Cisco Talos Blog
Cisco Talos Blog
罗磊的独立博客

博客园 - Jacker.W

sql经典语句 (机加类)生产计划管理系统介绍 c# 自定义甘特表格控件 (原创 学习中请指导) MasterCam9 CNC程序文件转刀单 程序 关闭UPD123、1900、137、138和TCP135、139、445、3389端口的方法 - Jacker.W - 博客园 网络不存在或尚未启动的解决方法 关于幸福 这两天怎么了? 古名人们啊,该你们站起来澄清的时候到了! 《财经法规与会计职业道德》学习小记(一) 《会计基础》学习小记(一) 芙蓉障里人工湖 可怜的包法利夫人 奥运年来了 教你如何防范电脑病毒入侵 今天学习灭火,灭火演习正上演 “嫦娥一号”可以证明美国当年登月是否属实 晒晒可恶垃圾短信 征烧烤广告宣传图
sql2008分区表相关SQL语句
Jacker.W · 2016-02-25 · via 博客园 - Jacker.W

--1、新建文件组OrderFG4

ALTER DATABASE TestDB ADD FILEGROUP OrderFG4

--2、新建文件OrderFG4.NDF,并联文件组OrderFG4

ALTER DATABASE TestDB  ADD FILE ( 
NAME = N'OrderFG4',
FILENAME = N'G:\data\OrderFG4.ndf' ,
SIZE = 3072KB ,
FILEGROWTH = 1024KB
) TO FILEGROUP OrderFG4

--3、建立分区函数
create partition function ft_PartOrders(Datetime)
as range right
for values('2013-01-01','2015-01-01','2017-01-01')
--4、建立分区方案,即关联文件组
create partition scheme sc_PartOrders
as partition ft_PartOrders
to(OrderFG1,OrderFG2,OrderFG3,OrderFG4)
--5、建立表格,关联分区方案
create table PartOrders
(
OrderID int identity(10000,1),
OrderDate datetime not null,
CustomerID int not null,
constraint PK_Orders primary key(OrderID,OrderDate)
)
on sc_PartOrders(OrderDate)
--6、查询第一个分区数据
select *from PartOrders where $partition.ft_PartOrders(OrderDate)=1
--7、查询反馈分区号
select $partition.ft_PartOrders('DateTime')
union all
select $partition.ft_PartOrders('DateTime')
--8、归档分区数据,即删除原分区记录,复制到历史文件中的分区中
alter table PartOrders switch partition 1 to PartOrdersHis Partition 1
--9、修改分区方案
alter partition scheme sc_PartOrders next used OrderFG4
--10、修改分区函数
alter partition function ft_PartOrders() split range('DateTime')
--11、删除分区函数中的一个节点
alter partition function ft_PartOrders() merge range('DateTime')
--12、查询系统视图中的分区函数,分区方案,边界值点
select * from sys.partition_functions
select * from sys.partition_range_values
select * from sys.partition_schemes