0

如何在具有 100 多个表的数据库中查找某个列?

例如,在前端,我看到一个显示数据的选项卡。

A information with columns = email's, mailbox, note1, sent dt/tm, note2 etc.. but in the DB there are about 100+ Tables (messy), 

我只想找到包含 A 信息列的表,而不扩展每个表的列来调查列 = 电子邮件、邮箱、note1、发送​​ dt/tm、note2 等的位置。有没有简单的方法在 SQL Server Management Studio 上执行此操作?

4

2 回答 2

1
sp_msforeachdb 'USE ?;  Select *
From INFORMATION_SCHEMA.COLUMNS
Where Column_Name like ''%Col%'''
于 2014-11-15T03:10:59.150 回答
0

尝试信息架构:

Select *
From INFORMATION_SCHEMA.COLUMNS
Where Column_Name like '%Col%'
于 2014-11-14T23:36:12.057 回答