Home > Database > Mysql Tutorial > 查找本库包含某字段的所有表

查找本库包含某字段的所有表

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 15:55:49
Original
1269 people have browsed it

数据库表格多了,想找出包含某个字段的所有表。 --syscolumns 和 sysobjects 是数据库 维护的 列集表 和 表集表SELECT col.name TableName FROM syscolumns col JOIN sysobjects tab ON col.id = tab.id AND tab.type=U AND col.name=Phone

数据库表格多了,想找出包含某个字段的所有表。

--syscolumns 和 sysobjects 是数据库 维护的 列集表 和 表集表
SELECT col.name  TableName   
  FROM syscolumns col  
  JOIN sysobjects tab ON col.id = tab.id    
   AND tab.type='U'    
   AND col.name='Phone'
Copy after login


 

Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template