天天看點

[SQL] 查找資料庫中含有某字段的所有表

select a.name 表名,b.name 列名

from sysobjects a,syscolumns b

where a.id = b.id and b.name = 'selling_prict_ctrl_flag'

--and a.type='U'

SELECT

b.name as TableName,a.name as columnname

From syscolumns a

INNER JOIN sysobjects b

ON a.id=b.id

AND b.type='U'

where a.name='selling_price_ctrl_flag'

轉載于:https://www.cnblogs.com/withoutaword/archive/2013/03/26/2982170.html