Dear all:
I had put "partition_show" before . but this time it makes faster.

partition_show:

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

create view [dbo].[partition_show]
as
WITH tobjectid AS
(
select t.object_id from sys.tables as t inner join sys.indexes
as i on t.object_id=i.object_id and i.type in (0,1) inner join sys.partition_schemes ps
on i.data_space_id=ps.data_space_id
)
SELECT distinct OBJECT_NAME(T2.object_id) TABLE_NAME
,T1.partition_number
,T4.name as "function_name"
,T3.name as "schema_name"
,T7.name File_group_name
,T1.rows
,CASE boundary_value_on_right
WHEN 1 THEN 'less than'
ELSE 'less than or equal to ' END as 'comparision'
--,CONVERT(varchar(100), T5.value, 112) value
,T5.value value
FROM sys.partitions T1
INNER JOIN sys.indexes T2
ON T1.object_id = T2.object_id
INNER JOIN sys.partition_schemes T3
ON T2.data_space_id = T3.data_space_id
INNER JOIN sys.partition_functions T4
ON T3.function_id = T4.function_id
LEFT JOIN sys.partition_range_values T5
ON T4.function_id = T5.function_id
AND T1.partition_number = T5.boundary_id
INNER JOIN sys.destination_data_spaces T6
ON T6.partition_scheme_id = T3.data_space_id
AND T6.destination_id = T1.partition_number
INNER JOIN sys.filegroups T7
ON T6.data_space_id = T7.data_space_id
/*where T2.object_id in (select OBJECT_ID(t.name) from sys.tables as t inner join sys.indexes as i on t.object_id=i.object_id and i.type in (0,1) inner join sys.partition_schemes ps on i.data_space_id=ps.data_space_id) */
where T2.object_id in (select object_id from tobjectid)
AND T1.index_id<=1
GO

partition_show , a new version to check partition table status in sqlserver的更多相关文章

  1. 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 ...

  2. Mycat+Mysql 插入数据报错 i[Err] 1064 - partition table, insert must provide ColumnList

    使用Navicat连接Mycat 8066 成功插入了分库表和全局表 1.全局表 sql如下: '); '); '); 插入成功! 2.分库表 sql如下: ', null, null, null, ...

  3. WARNING: Re-reading the partition table failed with error 16: Device or resource busy.

    在 mkfs.ext4 /dev/sda2 格式化硬盘空间时,可能出现这种错误. had this situation at office where I was told to re-partiti ...

  4. WARNING: Re-reading the partition table failed with error 22: Invalid argument

    在划分磁盘分区时,遇到错误"WARNING: Re-reading the partition table failed with error 22: Invalid argument&qu ...

  5. 【问题解决方案】之 jmeter启动报错:Not able to find Java executable or version. Please check your Java installation

    故事发生在云计算实验课上-- ** 故事发生在云计算实验课上-- Step 1 在Xshell中登录自己的cloud虚拟机后,<sudo su ->切换到root用户 Step 2 < ...

  6. oracle partition table 分区表详解

    Oracle partition table 分区表详解 分区表就是通过使用分区技术,将一张大表,拆分成多个表分区(独立的segment),从而提升数据访问的性能,以及日常的可维护性.分区表中,每个分 ...

  7. 计算机启动出现 Invalid Partition Table

    计算机启动出现 Invalid Partition Table 解决办法 使用大白菜启动盘进入临时系统,打开程序DiskGenius 如果系统盘(一般为 C 盘)非活动状态,先激活 如果装系统的硬盘不 ...

  8. 小米2s线刷出现remote: partition table doesn't exist

    =================问题============ 小米2s线刷出现remote: partition table doesn't exist =================解决方案= ...

  9. GUID Partition Table (GPT)

    https://en.wikipedia.org/wiki/GUID_Partition_Table https://zh.wikipedia.org/wiki/全局唯一标识分区表 GUID Part ...

随机推荐

  1. Springmvc-crud-07(springmvc标签错误)

    错误:springmvc标签错误 原因:1.在springmvc中的form标签中没有绑定modelAttribute属性 2.必须要获取到参数(可以创建map对象,进行存储参数,再用modelAtt ...

  2. 安装Anaconda3时出现conda不是内部或者外部命令

    在win10,64位,python版本为3.7的环境下安装anaconda3的时候,无法在命令行执行conda命令,一直提示conda不是内部或者外部命令,参考网上的修改环境变量,修改完后还是没有用, ...

  3. 【HTML】输入密码访问

    <script> (function(){ if('{{ page.password }}'){ if (prompt('请输入文章密码') !== '{{ page.password } ...

  4. ax绘图相关的知识点

    1.去边框 # 去掉上.下.左.右边框 ax.spines['top'].set_visible(False) ax.spines['bottom'].set_visible(False) ax.sp ...

  5. python opencv:绘图 基本图形

    参数说明 • img:你想要绘制图形的那幅图像. • color:形状的颜色.以 RGB 为例,需要传入一个元组,例如:( 255,0,0)代表蓝色.对于灰度图只需要传入灰度值. • thicknes ...

  6. PyQt5单元格操作大全

    1.显示二维列表数据(QTableView)控件 '''显示二维列表数据(QTableView)控件数据源model需要创建一个QTableView实例和一个数据源model,然后将其两者关联 MVC ...

  7. IO课堂测试

    一,用户需求 英语的26 个字母的频率在一本小说中是如何分布的?某类型文章中常出现的单词是什么?某作家最常用的词汇是什么?<哈利波特与魔法石> 中最常用的短语是什么,等等. (1)要求1: ...

  8. 第3章 Java基本的程序设计结构

    3.运算符 浅谈java中源码常见的几个关键字(native,strictfp,transient,volatile) 需要注意 , 整数被 0 除将会产生一个异常, 而浮点数被0 除将会得到无穷大或 ...

  9. 树莓派4B踩坑指南 - (10)安装坚果云(更新:暂不支持)

    191209更新: 根据坚果云用户支持(helpdesk@nutstore.net)的官方回复,客户端不支持arm,所以本篇后续内容可以不用看了.. 原文如下: "您好,客户端似乎不支持ar ...

  10. 误删/boot下文件或目录的修复方式!

    步骤:进入硬盘的急救模式,进入磁盘,挂载光盘到/media上,rpm安装内核到media目录下,从装grub程序到/dev/sda,然后将grub文件从定向到/boot下,然后重启. 第一步:进入bi ...