Many a times we need to find all tables having a particular column in a database. Here is a T-SQL script to find column in database.

The above query uses sys.objects  , sys.columns and sys.types to find all tables having a column “AddressID”. The output from the above query is given below.

1_t sql script to find column in database

The other way is to use the Information_Schema view as shown below

The output from the above query is shown below.

2_T sql script to find column in database

 

Regards

Ahmad Osama

Like us on FaceBook Join the fastest growing SQL Server group on FaceBook

Follow me on TwitterFollow me on FaceBook