Code2night
  • Home
  • Guest Posts
  • Tutorial
  • Languages
  • Post Blog
  • Tools
    • JSON Beautifier
    • HTML Beautifier
    • XML Beautifier
    • CSS Beautifier
    • JS Beautifier
    • PDF Editor
    • Word Counter
    • Base64 Encode/Decode
    • Diff Checker
    • JSON to CSV
    • Password Generator
  • Register
  • Login
  1. Home
  2. Blogpost

How to find all tables by column name

Date- Jan 13,2023

6466

Sql server

Hello, readers, and welcome to Code2Night! In today's blog post, we're going to delve into the world of SQL Server and explore a common challenge that many developers face while working with large databases. Have you ever found yourself in a situation where you needed to find all the tables where specific columns were being used? If so, you're in the right place.

Working with extensive databases can be quite daunting, especially when you're trying to track down specific columns across numerous tables. Whether you're debugging an issue, optimizing performance, or simply trying to understand the database structure, finding the tables where certain columns are used can save you significant time and effort.

Fortunately, SQL Server provides us with powerful tools and techniques to tackle this challenge effectively. In this blog post, we'll explore various methods that will help us locate all the tables in our database that contain specific columns. From built-in functions to querying system tables, we'll cover a range of techniques that cater to different scenarios.

By the end of this post, you'll have a solid understanding of how to find tables with specific columns in SQL Server, empowering you to navigate your database with ease and efficiency. So, let's dive in and unlock the secrets of uncovering the tables where those sought-after columns reside.

Remember to bookmark this page or subscribe to our newsletter to stay updated with the latest tips, tricks, and insights for your SQL Server journey. Let's get started and master the art of discovering tables with specific columns in SQL Server!

SQL

So, in SQL server we often have to find all the tables by column name or you can say where we have used a specific column name. So for that purpose, we can use the following query. 

select * from INFORMATION_SCHEMA.COLUMNS 
where COLUMN_NAME like '%key%' 
order by TABLE_NAME

This query will return to us all the tables where we have used the Key column anywhere. You can have a look at the following image where we have found all tables  where specified column as useTables

So you can modify your column name in the place of the "key" accordingly and fetch out the correct results. This is how to find all tables by column name in the SQL server.

S
Shubham Batra
Programming author at Code2Night โ€” sharing tutorials on ASP.NET, C#, and more.
View all posts โ†’

Related Articles

How to rename table column in sql server
Jan 13, 2023
How to find all procedures having table reference in Sql server
Jan 13, 2023
How to read json in Sql Server
Aug 10, 2022

Comments

Tags

AspNet
C#
programming
AspNet MVC
c programming
AspNet Core
C
software development
tutorial
MVC
memory management
Paypal
coding
coding best practices
data structures
programming tutorial
tutorials
object oriented programming
Slick Slider
StripeNet
Free Download for Youtube Subscribers!

First click on Subscribe Now and then subscribe the channel and come back here.
Then Click on "Verify and Download" button for download link

Subscribe Now | 1760
Download
Support Us....!

Please Subscribe to support us

Thank you for Downloading....!

Please Subscribe to support us

Continue with Downloading
Be a Member
Join Us On Whatsapp Join Us On Facebook
Code2Night

A community platform for sharing programming knowledge, tutorials, and blogs. Learn, write, and grow with developers worldwide.

Panipat, Haryana, India
info@code2night.com
Quick Links
  • Home
  • Blogs
  • Tutorials
  • About Us
  • Contact
  • Privacy Policy
  • Terms & Conditions
  • Guest Posts
Free Dev Tools
  • JSON Beautifier
  • HTML Beautifier
  • CSS Beautifier
  • JS Beautifier
  • Password Generator
  • QR Code Generator
  • Hash Generator
  • Diff Checker
  • Base64 Encode/Decode
  • Word Counter
By Language
© 2026 Code2Night. All Rights Reserved.
Made with for developers  |  Privacy  ยท  Terms
Translate Page