【原】根據字段查來源表

use tempdb;

select t1.name as [字段名稱],t2.name as [表名稱]
from syscolumns as t1
join sysobjects as t2 on t1.[id] = t2.[id]
where
t1.id in (select object_id(name) from sysobjects where type='U')
and t1.name = '已知的字段名稱';

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章