T-SQL Find column name in database

My Learning: Log in Learning Report [Log in]


Remove Ads or Log in
Remove Ads or Log in
+0  |  -0
Very often you need to use a specific field from sql server database table. The problem is how to find column name in database in any table using tsql? The answer is use information_schema and more precisely information_schema.columns

This is easy. Just open new query select the database from the drop down box you want to search and type

select *
from information_schema.COLUMNS
where column_name like '%name%'

The sql query above will show you every column that contains value ‘name’. If you have many results you can eliminate them by filtering it using the available columns. Usually table name field can be used to limit the results for instance if you are after name but for an employee you could try:

select *
from information_schema.COLUMNS
where column_name like '%name%' and table_name like '%emp%'


Remove Ads or Log in

We need you!

By becoming a proud member we can:
  • Switch off annoying ads
  • Create more articles and videos
  • Develop more useful features supporting your learning
  • Provide FREE webinars (for members)
  • Feel our hard work since 2011 is appreciated
Become a proud member and get exclusive features.

If 2% of our 64,943 visitors (Last 30 days) become a proud member than we can quit our jobs and work full time on this website. We started membership in May 2014 and so far 0.07% of our visitors are members and we would like to say THANK YOU to those who become a proud member and support our efforts.

Thanks to members:
  • Education is for FREE and we create more FREE articles and videos
  • We provide new features (members) that can speed up learning.
  • 53% of our page views (82,000 each month) do not have page ads.
  • We switched video ads from 14% of our videos (50 out of 345).
We have invested 4 years of our time in this website and we estimate it will take about 5 years before we can quit our jobs and dedicate all our time to develop considerably our website which should help to truly achieve our vision of free education for everyone; all thanks to support of our members only. Become a proud member

Visitor Voting

Visitor comment (we like):
"I like you both, you read Dale Carnagie, you want what most of us want and you are trying to do something useful for all! You are already successful! Blessings!"
Add comment (no email required).



Add Comment
No data was returned.


Are you a member?

If yes than please log in

Learning Map is for members with Bronze, Silver and Gold Membership.
For more information visit membership options.


Close this window , log in or learn more about membership benefits
  Become a Proud Member