Search database

What is the fastest way to find which table the field is in? I just started working in a new company, and I am not yet familiar with their DB schema. I often have a metric or dimension that I need to look for, and it seems very time consuming since they have a very large database.

I know this is a vague question, and there is no better answer, but I am looking for the best practices, tips and tricks that people have learned over the years that I could use in this case.

+4
source share
2 answers

You can use sys.columnsfor this:

SELECT 
    OBJECT_NAME(c.object_id)
FROM sys.columns c
WHERE c.name = <column_name>
+4
source

I usually use the following query when Im looking for a field.

SELECT * FROM information_schema.COLUMNS c WHERE c.COLUMN_NAME LIKE 'search_field%'

, .

, , , " ", , , .

+1

All Articles