Tip: Finding tables and columns fast in SQL Server Management Studio: create a script and then search

Posted: (EET/GMT+2)

 

Lately, I've faced a little database processing task for one of my clients. They have an SQL Server database, and I needed to do some digging on the data. The database had about 700 tables, some of which I knew, but not all. Those tables totaled probably thousands of columns.

I needed to find one particular column across the whole database. Yes, in SQL Server Management Studio (SSMS), you can list your table and see all the columns in each table, but looking at each individual table isn't very efficient.

What is a better way, then? My solution was to use SSMS to generate the SQL script for the whole database, which generated you one big SQL script. (If you don't have the permission for this, ask the script from someone who does.) Then, open the script in your favorite editor, or just SSMS itself, and then search. You are able to find your tables/columns almost instantly.

Hope this helps!