查找包含某字段名的表名
select a.name as 表名
from sysobjects a
left join syscolumns b on a.id=b.id
where a.xtype='U' and b.name='字段名'
--查找不包含指定字段的表名
select a.name as 表名
from sysobjects a
left join syscolumns b on a.id=b.id
where a.xtype='U'
EXCEPT
select a.name as 表名
from sysobjects a
left join syscolumns b on a.id=b.id
where a.xtype='U' and b.name='字段名'
'
'