从sysindexes和sysobjects系统,可以获取用户表的一些数据,如果表名,创建时间,表存储的记录数等。
下面代码,是代码运行的当前数据库的用户表数据。
select o.[name],[crdate],max(i.[rows]) as [rows] from sysindexes as i inner join sysobjects as o on (i.[id] = o.[id]) where o.[xtype] = 'u' group by o.[name],[crdate] order by [rows] desc