--生成用户创建的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的更多相关文章

  1. hibernate配置之<property name="hbm2ddl.auto">create</property>导致每次创建SessionFactory都清空数据库中的数据

    参考:http://stackoverflow.com/questions/6611437/how-to-make-hibernate-not-drop-tables 我遇到的问题就是: List l ...

  2. Auto Create Editable Copy Font(Unity3D开发之二十二)

    猴子原创,欢迎转载.转载请注明: 转载自Cocos2Der-CSDN,谢谢! 原文地址: http://blog.csdn.net/cocos2der/article/details/48318879 ...

  3. Oracle 11gR2 create init script

    设置oracle用户变量. [oracle@db01 ~]$ vi /etc/oratab # end line: change db01:/oracle/app/product/11.2.0/db_ ...

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

  5. hibernate.hbm2ddl.auto配置详解

    hibernate.cfg.xml 中hibernate.hbm2ddl.auto配置节点如下:<properties><property name="hibernate. ...

  6. Hibernate hbm2ddl.auto DDL语句 控制台输出的配置

    在开发中我们需要知道hbm2ddl.auto生成的SQL语句,来判断代码的正确性,现在记录配置的过程. Hibernate的DDL语句在控制台的输出配置: 一.在lib中确保只有下面的三个相关包:1) ...

  7. RMAN_学习笔记5_RMAN Catalog Script恢复目录脚本

    2014-12-24 Created By BaoXinjian

  8. Mingyang.net:hibernate.hbm2ddl.auto配置详解【转】

    原文地址:http://www.cnblogs.com/feilong3540717/archive/2011/12/19/2293038.html hibernate.cfg.xml 中hibern ...

  9. js原型链接(二)和object类的create方法

    原型链的内部执行方式 <script> function Myclass(){ this.x=" x in Myclass"; } var obj=new Myclas ...

随机推荐

  1. offset、client、scroll、screen的自己理解

    body是DOM对象里的body子节点,即 <body> 标签: documentElement 是整个节点树的根节点root,即<html> 标签: window.scree ...

  2. oracle 单实例DG(配置篇二)

    一,DG搭建实例--主库配置 one : 归档配置 01,查看归档  1 select log_mode,force_logging from v$database; 02,开启归档 关闭数据库重新启 ...

  3. Oracle 系统常用命令

    1.基本口令 1.1.show user                               作用:显示当前连接用户 1.2.conn 用户名/密码                       ...

  4. TT8509: PL/SQL execution terminated; PLSQL_TIMEOUT exceeded

    TT8509: PL/SQL execution terminated; PLSQL_TIMEOUT exceeded plsql_timeout连接超时,解决办法: ODBC pl/sql选项卡 修 ...

  5. BNU4286——Adjacent Bit Counts——————【dp】

    Adjacent Bit Counts Time Limit: 1000ms Memory Limit: 65536KB 64-bit integer IO format: %lld      Jav ...

  6. 浅谈 .NET Framework 与 .NET Core 的区别与联系

    2017到了,咱们学点啥啊,要想知道学点啥,先弄清.NET Framework 与 .NET Core  这两个概念 .当今 net 生态系统如下: 从上面图中我们可以看到.net  主要分为三个部分 ...

  7. small zhishi

    \\192.168.1.201\d$\Data 访问远程计算机文件资源管理器

  8. 07.使用FileStream类来实现对大文件的复制

    namespace _20.使用FileStream类来实现多媒体文件的复制 { class Program { static void Main(string[] args) { //需要被复制的文 ...

  9. 那些你常用的JSP知识

    脚本程序 <> 或者,您也可以编写与其等价的XML语句,就像下面这样: <jsp:scriptlet> 代码片段 </jsp:scriptlet>任何文本.HTML ...

  10. PHP file_put_contents() 函数

    file_put_contents() 函数把一个字符串写入文件中. 与依次调用 fopen(),fwrite() 以及 fclose() 功能一样. 语法如下 file_put_contents(f ...