码迷,mamicode.com
首页 > 数据库 > 详细

显示数据库中所有表的记录数

时间:2015-01-27 09:18:05      阅读:181      评论:0      收藏:0      [点我收藏+]

标签:

SELECT o.name, 
ddps.row_count 
FROM sys.indexes AS i 
INNER JOIN sys.objects AS o ON i.OBJECT_ID = o.OBJECT_ID 
INNER JOIN sys.dm_db_partition_stats AS ddps ON i.OBJECT_ID = ddps.OBJECT_ID 
AND i.index_id = ddps.index_id 
WHERE i.index_id < 2 
AND o.is_ms_shipped = 0 
ORDER BY o.NAME 

 

显示数据库中所有表的记录数

标签:

原文地址:http://www.cnblogs.com/toosuo/p/4251871.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!