I want to find party_no column for table1 which doesn't have it. Table1 has appl_id & co_no in it. I want to find a table which has party_no, appl_id & co_no all in a single table so that I can join table1 with that specific table to get the party_no for those records from table1.
Ideally you should have this information from some kind of model.
But you can find that information using DBC.COLUMNS view.
Hi Adeel, It is interesting. Can you give any sample query on DBC.columns for above requirment pls.
How about say:
select databasename,tablename,columnname from dbc.columns where databasename in('dbc','retail'.....)
and columnname in('your column here'....)
If I understand it correctly.
select DatabaseName, TableName
where ColumName in ('party_no', 'appl_id', 'co_no')
group by 1,2
having count(*) = 3
Thanks Dieter! I was thinking on same lines, its just I was selecting all three columns.