-- 记录下,按照表的记录数倒叙
SELECT a.name, b.rows
FROM sysobjects AS a INNER JOIN sysindexes AS b ON a.id = b.id
WHERE (a.type = 'u') AND (b.indid IN (0, 1))
ORDER BY b.rows DESC
过程
--将XXX替换成你要查找的内容
select name
from sysobjects o, syscomments s
where o.id = s.id
and text like '%XXX%'
and o.xtype = 'P'