How to find the tables that uses the specific column name in the database (oracle 9i)?
Printable View
How to find the tables that uses the specific column name in the database (oracle 9i)?
Welcome to the Forum :wave:
Without knowing the Database that you are using, it is almost impossible to give a solution or suggest something. You need to tell us which database you are using.
For SQL 2000, you can usePHP Code:Select
TABLES.[NAME] As TableName
From
SYSOBJECTS TABLES
Inner Join SYSCOLUMNS FIELDS
On TABLES.ID = FIELDS.ID
Where
FIELDS.[NAME] = 'MYFIELDNAME'
Hi all (and happy new year)
It's quite simple; run the query
It extracts all tables of the schema which have the column 'MY_COLUMN'Code:SELECT TABLE_NAME
FROM USER_TAB_COLUMNS
WHERE COLUMN_NAME = 'MY_COLUMN'
If you use DBA_TAB_COLUMNS instead of USER_TAB_COLUMNS, you'll find all table in any schema of the instance which have a specified column.