find sql table name with a particular column

前端 未结 3 570
予麋鹿
予麋鹿 2020-12-14 15:31

Is their any other way or sql query to find the database table names with a particular column than shown below,

SELECT TABLE_NAME FROM INFORMATI         


        
3条回答
  •  感情败类
    2020-12-14 16:00

    you can run this query

    SELECT t.name AS table_name,
    SCHEMA_NAME(schema_id) AS schema_name,
    c.name AS column_name
    FROM sys.tables AS t
    INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID
    WHERE c.name LIKE '%Column%' -- write the column you search here
    ORDER BY schema_name, table_name;
    

提交回复
热议问题