SQLSERVER 数据库查看各表的记录数
SQLSERVER 数据库查看各表的记录数
SQL Code:
ALTER PROCEDURE _usp_sys_QueryTableRows
AS
BEGIN
/************************************************************
SQLSERVER 数据库查看各表的记录数
_usp_sys_QueryTableRows
*************************************************************/
--每个表的记录数
select a.name as 表名,max(b.rows) as 记录条数 from sysobjects a ,sysindexes b
where a.id=b.id and a.xtype='u'
group by a.name
order by max(b.rows) DESC
--所有表的记录数汇总
select SUM(记录条数) as 总记录数 from(
select top 10000 a.name as 表名,max(b.rows) as 记录条数 from sysobjects a ,sysindexes b
where a.id=b.id and a.xtype='u'
group by a.name
order by max(b.rows) desc
) t1
END
//来源:C/S框架网(www.csframework.com) QQ:1980854898
ALTER PROCEDURE _usp_sys_QueryTableRows
AS
BEGIN
/************************************************************
SQLSERVER 数据库查看各表的记录数
_usp_sys_QueryTableRows
*************************************************************/
--每个表的记录数
select a.name as 表名,max(b.rows) as 记录条数 from sysobjects a ,sysindexes b
where a.id=b.id and a.xtype='u'
group by a.name
order by max(b.rows) DESC
--所有表的记录数汇总
select SUM(记录条数) as 总记录数 from(
select top 10000 a.name as 表名,max(b.rows) as 记录条数 from sysobjects a ,sysindexes b
where a.id=b.id and a.xtype='u'
group by a.name
order by max(b.rows) desc
) t1
END
//来源:C/S框架网(www.csframework.com) QQ:1980854898
版权声明:本文为开发框架文库发布内容,转载请附上原文出处连接
NewDoc C/S框架网