DBC tables/views to extract Table, View and Macro, etc definitions

Database

DBC tables/views to extract Table, View and Macro, etc definitions

Hi,

Just wondering if there is someone here who have created a SQL to extract the definitions of all the Tables, Views, Macro etc.

Thanks,

Christian

2 REPLIES
Supporter

Re: DBC tables/views to extract Table, View and Macro, etc definitions

you can run 

select 'show ' !! case when tablekind = 'm' then 'macro' when tablekind = 't' then 'table' when tablekind = 'v' then 'view' end !! ' ' !! trim(databasename) !! '.' !! trim(tablename) !! ';'

from dbc.tables 

where tablekind in ('T','V','M');

and run the generated SQLs afterwards.

Fan

Re: DBC tables/views to extract Table, View and Macro, etc definitions

Hi Christian,

You can easily use the DBC.TVM table to extract that info.

Regards,

Lizarb