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 发表 http://bbs.chinaunix.net/images/common/back.gif
select tabname from systables where nrows = 0;

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

wuicpp 发表于 2008-04-04 14:18

原帖由 ivhb 于 2008-3-13 19:19 发表 http://bbs.chinaunix.net/images/common/back.gif


在没有做 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 发表 http://bbs.chinaunix.net/images/common/back.gif
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的通通剃掉不久结了
页: [1]
查看完整版本: 如何查询库中哪些表有数据