Chinaunix

标题: 如何查询库中哪些表有数据 [打印本页]

作者: ahqkxfer    时间: 2008-03-13 15:17
标题: 如何查询库中哪些表有数据
用dbexport出来,然后看哪些表有数据这种办法就别说了。。。
作者: xjfirst    时间: 2008-03-13 18:28
select tabname from systables where nrows = 0;
作者: ivhb    时间: 2008-03-13 19:19
原帖由 xjfirst 于 2008-3-13 18:28 发表
select tabname from systables where nrows = 0;


在没有做 update statistics 之前,这么做可能是不对的。
作者: wuicpp    时间: 2008-04-04 14:18
原帖由 ivhb 于 2008-3-13 19:19 发表


在没有做 update statistics 之前,这么做可能是不对的。


楼上说的太有道理了。
作者: wensan145    时间: 2008-04-14 11:36
先做个update statictics
作者: czw1413_cn    时间: 2008-04-14 13:03
提示: 作者被禁止或删除 内容自动屏蔽
作者: wstar    时间: 2008-06-16 16:29
原帖由 czw1413_cn 于 2008-4-14 13:03 发表
select "select count(*) from "||tabname from systables where tabid>99
把得到的内容执行一下


能不能解释一下?
作者: liaosnet    时间: 2008-06-16 16:33
标题: 回复 #7 wstar 的帖子
select "select count(*) from "||tabname from systables where tabid>99
其中的select tabname from systables where tabid>99;
就表示是数据库的所有表...
"select count(*) from " 仅是做为普通字符输出而已..
即select count(*) from <tabname>. count(*)大于0当然是有数据啰~~
作者: blackuhlan    时间: 2008-06-16 23:09
我不太懂哈,难道不能看看表占了多大空间吗,把占空间是0的通通剃掉不久结了




欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2