Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 13 Mar 2006 @ 12:00:25 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: SQL to display tables and their total record count
 
From:   Butt, Muhammad Affan

Run the query below in SQL Assistant and get the output in one file and you will have to remove couple of redundant lines to make the report look like the way you want.

HTH


Kind Regards,

Affan


     SELECT
     'SELECT ' || '''' || TRIM(BOTH FROM DATABASENAME) || '.' || TRIM(BOTH
     FROM TABLENAME) || '''' || ' AS col1,' || ' COUNT(*) AS ROW_COUNT FROM '
     || TRIM(BOTH FROM DATABASENAME) || '.' || TRIM(BOTH FROM TABLENAME) ||
     ';'
     FROM DBC.TABLES
     WHERE DATABASENAME = 'DT_TAB' AND TABLEKIND ='t'
     ORDER BY 1


     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023