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=‘字段名‘
‘
时间: 2024-10-10 15:09:45