作者:binbin | 来源:互联网 | 2024-09-26 19:34
–统计一个数据库内所有表的记录条数总和selectSUM(rowcounts)from(SELECTOBJECT_NAME(id)AS[TBName],MAX(rowcnt)[ro
–统计一个数据库内所有表的记录条数总和
select SUM(rowcounts)
from (SELECT OBJECT_NAME(id) AS [TBName],MAX(rowcnt)[rowcounts]
FROM sys.sysindexes GROUP BY OBJECT_NAME(id))ss
–统计一个数据库中有多少张表的SQL语句
select count(*) from sysobjects where xtype=’U’