Saturday, October 2, 2021

Find Column Name From All Tables of Database

Find the column name present in all tables in the database. You use below query to find out.

For Example Column Name: Id present in list of tables in database

SELECT AS table_name, SCHEMA_NAME(schema_id) AS schema_name, AS column_name
    FROM sys.tables AS t
    INNER JOIN sys.columns c ON t.OBJECT_ID = c.OBJECT_ID
        where like 'Column Name%'
    ORDER BY schema_name, table_name;


No comments:

Post a Comment