--select * from sysobjects where xtype='U' order by name
-- 데이터베이스의 사용자 테이블 중 특정 필드가 있는 테이블만 호출한다.
select tbl.name, col.name colnm
from (
select id,
name
from sysobjects
where xtype = 'U'
--and name = 'tblBBS_DTQNA'
and name in ( select name from sysobjects where xtype='U' )
) tbl
inner join syscolumns col on col.id = tbl.id
left outer join sysindexkeys idx on idx.id = col.id and col.colid = idx.colid and indid = 1
where col.name in ( 'dtPubDate' )
order by tbl.name
Posted by 홍반장