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.
| Author |
Topic |
|
bcarney
Starting Member
7 Posts |
Posted - 2012-06-14 : 08:07:59
|
| I am working with a DB that has approx. 3000 tables and views. Is there a way to search and identify all tables or views with a specific column name?Thanks in advanceBrian |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-06-14 : 08:09:04
|
selectt.name as tablename,s.name as columnnamefrom sys.objects tjoin sys.columns son s.Object_Id = t.Object_Idwhere s.name like '%searchvalue%'order by t.name,s.name No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
bcarney
Starting Member
7 Posts |
Posted - 2012-06-14 : 08:10:38
|
| Great! Thanks for the Help...Brian |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2012-06-14 : 12:18:19
|
or justSELECT *FROM INFORMATION_SCHEMA.COLUMNSWHERE COLUMN_NAME like '%searchvalue%' ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
|
|
|