如何计算我的数据库中表/视图/索引的数量 [英] how to count number of tables/views/index in my database

查看:28
本文介绍了如何计算我的数据库中表/视图/索引的数量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何计算我的数据库中表/视图/索引的数量

how to count number of tables/views/index in my database

我使用的是 sybase 11

I am using sybase 11

推荐答案

select count(*) from sysobjects where type = 'U'

应该为您提供用户表的数量.您还可以使用 type = 'V' 来计算观看次数.

should get you the number of user tables. You can also use type = 'V' to count views.

select count(*) from sysindexes 

会给你一个索引计数.不过,您可能需要进一步过滤两者,具体取决于您想要的索引类型.

will give you an index count. You may need to further filter both though, depending on which types of indexes you want.

sysobjects 参考 此处.
sysindexes 参考 这里.

sysobjects reference here.
sysindexes reference here.

这篇关于如何计算我的数据库中表/视图/索引的数量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆