简体   繁体   English

具有特定列的事实表列表

[英]List of fact table which has a specific column

I am looking for a way to find all the fact tables which has a specified column name.我正在寻找一种方法来查找所有具有指定列名的事实表。 Is there any way we can find that?我们有什么办法可以找到吗? or the only way is to manually look into one table after the other?或者唯一的方法是手动查看一张桌子?

For Instance, think of it like a Column Name: Claim_Id how do I find all the fact tables that has this column name within it?例如,将其想象为列名:Claim_Id 如何找到其中包含此列名的所有事实表?

select schema_name(tab.schema_id) as schema_name,
tab.name as table_name, 
col.column_id,
col.name as column_name, 
t.name as data_type,    
col.max_length,
col.precision
from sys.tables as tab
   inner join sys.columns as col
       on tab.object_id = col.object_id
   left join sys.types as t
      on col.user_type_id = t.user_type_id
WHERE COL.name='UpdatedDate'
order by schema_name,table_name,column_id;

You can use something like that你可以使用类似的东西

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM