auto create statistic script
--生成用户创建的statistic脚本
select
object_name(stout.object_id),
stout.name,
'CREATE STATISTICS '+ stout.name+' ON '+ Schema_name(tab.schema_id)+'.'+object_name(stout.object_id) +'(' +
STUFF(( select ',' + col.name
from sys.stats stin
join sys.stats_columns stc on stin.object_id = stc.object_id and stin.stats_id = stc.stats_id
join sys.columns col on stc.column_id = col.column_id and stc.object_id = col.object_id
where stout.object_id = stin.object_id and stout.stats_id = stin.stats_id
FOR xml path('')), 1, 1, '') +')'+case when stout.filter_definition is not null then ' WHERE '+stout.filter_definition else '' end + ';' as script
from sys.stats stout
join sys.tables tab on stout.object_id = tab.object_id
where
stout.[object_id] = object_id( 'BigTable')
and stout.name not like 'WA_Sys%'--filter out system created
and user_created>0
auto create statistic script的更多相关文章
- hibernate配置之<property name="hbm2ddl.auto">create</property>导致每次创建SessionFactory都清空数据库中的数据
参考:http://stackoverflow.com/questions/6611437/how-to-make-hibernate-not-drop-tables 我遇到的问题就是: List l ...
- Auto Create Editable Copy Font(Unity3D开发之二十二)
猴子原创,欢迎转载.转载请注明: 转载自Cocos2Der-CSDN,谢谢! 原文地址: http://blog.csdn.net/cocos2der/article/details/48318879 ...
- Oracle 11gR2 create init script
设置oracle用户变量. [oracle@db01 ~]$ vi /etc/oratab # end line: change db01:/oracle/app/product/11.2.0/db_ ...
- How to Create a First Shell Script
How to Create a First Shell Script Shell scripts are short programs that are written in a shell pr ...
- hibernate.hbm2ddl.auto配置详解
hibernate.cfg.xml 中hibernate.hbm2ddl.auto配置节点如下:<properties><property name="hibernate. ...
- Hibernate hbm2ddl.auto DDL语句 控制台输出的配置
在开发中我们需要知道hbm2ddl.auto生成的SQL语句,来判断代码的正确性,现在记录配置的过程. Hibernate的DDL语句在控制台的输出配置: 一.在lib中确保只有下面的三个相关包:1) ...
- RMAN_学习笔记5_RMAN Catalog Script恢复目录脚本
2014-12-24 Created By BaoXinjian
- Mingyang.net:hibernate.hbm2ddl.auto配置详解【转】
原文地址:http://www.cnblogs.com/feilong3540717/archive/2011/12/19/2293038.html hibernate.cfg.xml 中hibern ...
- js原型链接(二)和object类的create方法
原型链的内部执行方式 <script> function Myclass(){ this.x=" x in Myclass"; } var obj=new Myclas ...
随机推荐
- PIE SDK矢量数据编辑的撤销和回退
1.功能简介 在数据的编辑过程中难免会出现失误,撤销和回退可以更好的编辑,下面对矢量数据编辑的撤销和回退功能进行介绍. 2.功能实现说明 2.1. 实现思路及原理说明 第一步 调用UndoComman ...
- PDFJs 在线预览插件
0.A.到官网 https://mozilla.github.io/pdf.js/getting_started/#download 下载最新版本B 部署到IIS 中访问 pdf.js/web/vie ...
- strus2配置strus.xml问题-The content of element type "package" must match "(result-types?,interceptors?
搭建strus2项目,在配置strus.xml时候碰到了这个问题: The content of element type "package" must match "( ...
- nginx 配置优化指令
worker_processes worker_processes指令是用来设计Nginx进程数,官方默认设为1,赋值太多了,将会对系统IO影响效率,降低Nginx服务器性能.但是为了让多核CPU能够 ...
- 121、Django rest framework入门使用
框架介绍 为你的django平台通过model生成对应的restfull api,并可以通过对应的http接口来进行 post .get.put.delete等操作.本文是也并非入门级别,不会带你去了 ...
- [shell基础]——echo命令
echo命令:在shell中主要用于输出 1. -n 不换行的显示结果(默认是换行的) 2. -e " " 支持双引号中使用一些特殊字符 常用的特殊字符有 \a 发出警告 ...
- WCF入门教程通信(二)
一.概述 WCF能够建立一个跨平台的安全.可信赖.事务性的解决方案,是一个WebService,.Net Remoting,Enterprise Service,WSE,MSMQ的并集,有一副很经典的 ...
- 深入理解JavaScript系列(12):变量对象(Variable Object)
介绍 JavaScript编程的时候总避免不了声明函数和变量,以成功构建我们的系统,但是解释器是如何并且在什么地方去查找这些函数和变量呢?我们引用这些对象的时候究竟发生了什么? 原始发布:Dmitry ...
- ThinkPHP3.2 整合支付宝RSA加密方式
RSA核心加密验证算法 <?php /** * RSA签名 * @param $data 待签名数据 * @param $private_key 商户私钥字符串 * return 签名结果 */ ...
- 从零开始的全栈工程师——html篇1.2
起名方式与CSS 一.起名方式(起名方式也叫选择器) 起名的目的是为了给标签添加属性 常见的3种选择器有 标签选择器 id选择器(使用的时候加#) class选择器(使用的时候加.) 样式的 ...