|
|
Archives of the TeradataForum
Message Posted: Mon, 13 Mar 2006 @ 12:00:25 GMT
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
| |