select o.name from sysobjects o
where xtype='u'
and exists (
select 1 from syscolumns c
where id=o.id
and name='字段名'
)
where xtype='u'
and exists (
select 1 from syscolumns c
where id=o.id
and name='字段名'
)
调试欢乐多
set @colname='xxx'
select a.name from sysobjects a,syscolumns b where a.id=b.id and b.name=@colname
from sysobjects O join syscolumns S on O.id=S.id
where S.name = 'colname'
select
b.name as 表名,
a.name as 字段
from syscolumns a,sysobjects b
where a.id=b.id
and a.name like '%字段%'
where exists (
select 1 from sys.columns c
where [object_id]=o.[object_id]
and name='HyperID'
)