How to find the number of columns in each table in Teradata ??

Tools
Enthusiast

How to find the number of columns in each table in Teradata ??

 
3 REPLIES
Enthusiast

Re: How to find the number of columns in each table in Teradata ??

Select tablename, count(Columnname) from dbc.tables where table_neme='MYTABLE' and Database='MYDATABASE' group by MYTABLE

Enthusiast

Re: How to find the number of columns in each table in Teradata ??

Hi,

dbc.tables wont give column details better u check below SQL for the number of columns :

Select tablename, count(Columnname) from dbc.columns where tablename='table_name' and Databasename='Database_name' group by tablename

Thanks

Nagendra

Teradata Employee

Re: How to find the number of columns in each table in Teradata ??

The Columns view will not work with extended object names. Use the modern ColumnsV view instead of the compatibility Columns view which is deprecated and will be eliminated in a future release. See the Data Dictionary Reference for details.

 

Thanks,

David