How to find a column in your database using SQL Server

I bet there were times when you didn’t know the structure of your database and you were looking for a specific column. Well that happens a lot when you start working on a new project, a new database and so on. A very easy way to find the column you were looking for is by using the below script.

Open a new query window in Microsoft SQL Server and paste in the below query. Make sure you have selected the correct database from the upper left corner of the screen.

Replace EmployeeID in the WHERE  clause withe the keyword you need.

Execute the query by pressing F5 or the Execute button.


SELECT AS table_name,
SCHEMA_NAME(schema_idAS schema_name, AS column_name
FROM sys.tables AS t
WHERE LIKE ‘%EmployeeID%’
ORDER BY schema_nametable_name;

Leave a Reply

Your email address will not be published. Required fields are marked *

four × four =

Time limit is exhausted. Please reload the CAPTCHA.

Subscribe to our newsletter and stay up to date with:

  • Latest posts
  • News and Articles
  • Products, Promotions and Giveaways

Get our FREE step by step guide to Building SSRS reports 101

Hide me
Show me
Build an optin email list in WordPress [Free Software]