Rabu, 06 Oktober 2010

SQL: how to find table by column name

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

Tidak ada komentar:

Posting Komentar