Hi,
What happens if you have about a hundred tables in unknown database, and all you know - it's column name in a table you look for? - The trick is quite simple: run next stored procedure, while replacing "THE_COLUMN_NAME" with your column name.
SELECT name FROM sysobjects WHERE id IN ( SELECT id FROM syscolumns WHERE name = 'THE_COLUMN_NAME' )
This one is good for a case, while you know only a part of column name:
SELECT name FROM sysobjects WHERE id IN ( SELECT id FROM syscolumns WHERE name like '%PART_OF_NAME%' )
Read more: Yonathan Masovich
What happens if you have about a hundred tables in unknown database, and all you know - it's column name in a table you look for? - The trick is quite simple: run next stored procedure, while replacing "THE_COLUMN_NAME" with your column name.
SELECT name FROM sysobjects WHERE id IN ( SELECT id FROM syscolumns WHERE name = 'THE_COLUMN_NAME' )
This one is good for a case, while you know only a part of column name:
SELECT name FROM sysobjects WHERE id IN ( SELECT id FROM syscolumns WHERE name like '%PART_OF_NAME%' )
Read more: Yonathan Masovich