teradata - How to find all tables / views with a column name that matches a particular pattern -
how find tables or views have column name matches pattern.
the pattern simple like %abcd%
pattern , not regex.
the query or queries should return both views , tables.
dbc.columnsv stores column information:
select databasename, tablename, columnname dbc.columnsv columnname '%abcd%' ;
this might return stored prodedures or macros, might better join dbc.tablesv:
select t.databasename, t.tablename, t.tablekind, columnname dbc.tablesv t join dbc.columnsv c on t.databasename = c.databasename , t.tablename = c.tablename columnname '%abcd%' , tablekind in ('t','v') ;
Comments
Post a Comment