All Forums Tools
info9891 43 posts Joined 09/14
11 Sep 2014
How to find the number of columns in each table in Teradata ??
info9891 43 posts Joined 09/14
11 Sep 2014

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

nagendratrpth 25 posts Joined 03/14
11 Sep 2014

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

david.craig 73 posts Joined 05/13
11 Sep 2014

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.

You must sign in to leave a comment.