从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