Welcome to plsql4all.blogspot.com SQL, MYSQL, ORACLE, TERADATA, MONGODB, MARIADB, GREENPLUM, DB2, POSTGRESQL.

Saturday, 25 October 2014

Find out list of tables in Teradata

We can fetch all the tables present in teradata database using below query:-

SELECT * FROM DBC.TABLES WHERE TABLEKIND ='T';

 Below command will show you the number of tables in all the Databases:-

SELECT  COUNT(*) FROM DBC.TABLES WHERE TABLEKIND ='T';

If you want to find the table list for a particular database then just add another where condition to it:-

SELECT * FROM DBC.TABLES WHERE TABLEKIND ='T' AND DATABASENAME ='UAT';

Below command will show you the number of tables in particular Databases:-

SELECT * FROM DBC.TABLES WHERE TABLEKIND ='T' AND DATABASENAME ='UAT';


As shown above you can find out Views, Procedures etc by altering where condition.

No comments:

Post a Comment

Please provide your feedback in the comments section above. Please don't forget to follow.