I want to show all tables that have specified column name

前端 未结 8 2446
粉色の甜心
粉色の甜心 2020-12-12 23:49

How can I get a list of all the tables that have a specific column name?

8条回答
  •  长情又很酷
    2020-12-13 00:04

    --get tables that contains selected columnName

    SELECT  c.name AS ColName, t.name AS TableName
    FROM sys.columns c
    JOIN sys.tables t ON c.object_id = t.object_id
    WHERE c.name LIKE '%batchno%'
    

    its worked...

提交回复
热议问题