Quantcast
Channel: Teradata Forums - All forums
Viewing all articles
Browse latest Browse all 27759

pulling all the tables and Views not using in prod since from long time in teradata - forum topic by SeenuGuddu

$
0
0

Hi Gurus,
Please help me suggesting a query to find for pulling all the tables and Views in teradata .
we have lot of backed up  temp tables and views not using in prod since from long time.
 
Please find the below SQL's
 


SELECT T.DatabaseName,T.tablename,C.Columnname 
FROM dbc.tables T, dbc.COLUMNS C
WHERE T.Databasename = C.Databasename
AND T.Tablename=C.Tablename 
AND LOWER(T.TableName) 
  IN  (  'Table_11_VW','Table_12_VW','Table_13_VW','Table_14_VW','Table_15_VW','Table_16_VW','Table_17_VW'  )
AND LOWER(C.ColumnName) = 'createdate'
AND  T.DatabaseName = 'Tables_VIEW'
ORDER BY 1,2


SELECT MAX(createdate),MIN(createdate),COUNT(*) FROM Table_11_VW;
SELECT MAX(createdate),MIN(createdate),COUNT(*) FROM Table_12_VW;
SELECT MAX(createdate),MIN(createdate),COUNT(*) FROM Table_13_VW;

Please share any queries or suggestions to find the tables and views
 
Thanks
 

Forums: 

Viewing all articles
Browse latest Browse all 27759

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>