--求存在相关字段的表,表会出现重复,同一个表的字段名不重复xtype=‘U’是表,xtype=‘V’是视图,xtype=‘P’ 是存储过程
SELECT syscolumns.name AS 字段名,sysobjects.name AS 表名 FROM syscolumns
INNER JOIN sysobjects ON syscolumns.id = sysobjects.id AND sysobjects.xtype = 'u'
WHERE syscolumns.name like '%ProviderGUID%'
--求存在相关字段的表,表不会出现重复
select [name] from sysobjects WHERE xtype = 'u'
AND id in(select id from syscolumns Where name like '%ProviderGUID%')