First, the operating environment
- Database version: sql server 2012
- Test Database: Northwind, installation method, please refer to this article
Second, query the database table INFORMATION_SCHEMA.COLUMNS
1. Create a new query, enter the following statement
SELECT
*
FROM
INFORMATION_SCHEMA.COLUMNS
View Results
can be obtained from each table column names the figure
increased to filter conditions
SELECT
TABLE_NAME
FROM
INFORMATION_SCHEMA.COLUMNS
WHERE
COLUMN_NAME='CustomerID'
#“CustomerID”为要查询的列名字段
The results are as follows