SQLserver查询库中包含某个字段的表

select [name] from [TPMS_PRD].[dbo].sysobjects 
where id in(select id from [TPMS_PRD].[dbo].syscolumns Where name='supplierid')

包含SupplierId这个字段的所有表

格式如下:

select [name] from [库名].[dbo].sysobjects where id in(select id from [库名].[dbo].syscolumns Where name='字段名')

@陈卧龙的博客

猜你喜欢

转载自www.cnblogs.com/chenwolong/p/10436902.html