Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Loop though all tables to find column

Author  Topic 

ajmufic
Starting Member

17 Posts

Posted - 2008-02-01 : 02:47:13
Hi.

I have a database with hundreds of tables most of the tables contains many columns.

Is there a way (of course there is) to loop through all the tables and return all the tables the contain a column with a specific name (there is more than one table containing this column).

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2008-02-01 : 03:10:31
make use of INFORMATION_SCHEMA.COLUMNS




KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

ajmufic
Starting Member

17 Posts

Posted - 2008-02-01 : 03:24:09
Thanks!
Go to Top of Page
   

- Advertisement -