Home Page for the TeradataForum
 
 

 

Archives of the TeradataForum





Message Posted: Fri, 10 May 2002 @ 15:04:09 GMT





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




Subj:   Re: SQL to get table name with row counts?
 
From:   Anomy Anom



<-- Anonymously Posted: Friday, May 10, 2002 09:38 -->

To get row counts for all tables you have to make two requests to the database and then format the results.

Request one is a select against DBC.tables to get all table names. The results of this select are a set of select statements that look like"

Select 'DB1.Tab1', count(*) from DB1.Tab1;.

Then run the select counts. You can do this in BTEQ by directing the results of pass 1 into a file and then issuing a run file against the created selects.

Another option would be to generate a set of insert or update statements instead of the select counts that put the counts generated in step 2 into a table. You could then dump out the table.





     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
 
  Top Home Join Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky 
Last Modified: 30 Jun 2008