zoukankan      html  css  js  c++  java
  • 查询SQL数据库中每一个表的大小

    --得到数据库中所有表的空间/记录情况 
    exec sp_MSForEachTable  @precommand=N' 
    create table ##( id int identity, 表名 sysname, 字段数 int, 记录数 int, 保留空间 Nvarchar(10), 使用空间 varchar(10), 索引使用空间 varchar(10), 未用空间 varchar(10))', @command1=N'insert ##(表名,记录数,保留空间,使用空间,索引使用空间,未用空间) exec sp_spaceused ''?''  update ## set 字段数=(select count(*) from syscolumns where id=object_id(''?''))  where id=scope_identity()', @postcommand=N'select * from ## order by id drop table ##'
  • 相关阅读:
    smarty基础
    smarty变量
    Google的Python代码格式化工具YAPF详解
    性能监控工具YourKit
    Scala学习笔记2
    Scala介绍
    线段树
    字符串分割方法
    Trie树
    Scala 学习笔记
  • 原文地址:https://www.cnblogs.com/zhangzt/p/2094054.html
Copyright © 2011-2022 走看看