Find a Column by name

Have you ever searched for a column with a specific name in a Database which consist of hundreds of tables?

Share This Post

Share on facebook
Share on linkedin
Share on twitter
Share on email

When looking for a specific column in a database, use the following SQL Query:

USE           AdventureWorks2014

GO

SELECT        c.name  AS ‘ColumnName’, t.name AS ‘TableName’

FROM          sys.columns c

JOIN          sys.tables  t   ON c.object_id = t.object_id

WHERE         c.name LIKE ‘Customer%’

ORDER BY     TableName, ColumnName;

Subscribe To Our Newsletter

Get updates and learn from the best

More To Explore

SQL Server

Create a SQL Database

When working with a Relational Database Management System (RDMS), you will want to create a database to store your information.

SQL Reference

Find a Column by name

Have you ever searched for a column with a specific name in a Database which consist of hundreds of tables?

Do You Want To Boost Your Business?

drop us a line and keep in touch