代码改变世界

[导入]view row count of all the tables(Stored Procedure on the SQL SERVER 2000)

2006-05-25 23:22  BAsil  阅读(66)  评论(0编辑  收藏  举报

-- Standard Utility Procs

CREATE VIEW dbo.vTableRowCount

as

SELECT TOP 100 PERCENT dbo.sysobjects.[name], dbo.sysindexes.[rows]

FROM dbo.sysindexes

JOIN dbo.sysobjects

ON dbo.sysindexes.[id] = dbo.sysobjects.[id]

WHERE (dbo.sysobjects.xtype = 'U')

AND (dbo.sysindexes.indid = 0

OR dbo.sysindexes.indid = 1)

ORDER BY dbo.sysindexes.[name]


文章来源:http://blog.donews.com/basilwang/archive/2004/12/10/199546.aspx