[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'

posted @ 2013-03-26 11:29  withoutaword  阅读(283)  评论(0编辑  收藏  举报