April 4, 2008 at 1:12 pm
Hello Everyone
Happy Friday
I am working with a large database, where all the tables were not named with descriptive names. How can I locate every table that contains a certain column?
Thanks
Andrew
April 4, 2008 at 1:18 pm
You can query view INFORMATION_SCHEMA.COLUMNS
select table_name ,column_name from information_schema.columns
where column_name = 'column_name'
April 4, 2008 at 1:23 pm
Another option.
SELECT t1.name, t2.name
FROM sys.tables t1
JOIN sys.columns t2 ON t2.object_id = t1.object_id
April 4, 2008 at 1:24 pm
Thanks
That was perfect, just what I needed
Have a good one
Andrew
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply