查詢字段在哪個(gè)表里有
select sysobjects.name from syscolumns inner join sysobjects on syscolumns.id = sysobjects.id and sysobjects.xtype = 'u' where syscolumns.name = '字段名字'
查詢數(shù)據(jù)庫(kù)里有哪些表志衍,哪個(gè)表有多少行數(shù)據(jù)
select a.name as '表名',b.rows as '表數(shù)據(jù)行數(shù)'
from sysobjects a inner join sysindexes b
on a.id = b.id
where a.type = 'u'
and b.indid in (0,1)
--and a.name not like 't%'
order by b.rows desc