Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Search a column in database

Suppose I have a database My_DB with hundreds of tables.

Now, I need to find about a particular column My_Emp_ID in my database.

I tried manually searching each table, but it is not efficient.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

What is the best way to find all the tables that contain column My_Emp_ID ?

You can assume that schema is same for all the tables present in the database.

Thanks.

>Solution :

select * 
from INFORMATION_SCHEMA.COLUMNS
where COLUMN_NAME = 'My_Emp_ID'
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading