Olá.

Vejam algumas select de exemplo utilizando o dicionário de Dados. Nesse caso estamos utilizando como regra tabelas que possuem chave de código de empresa e revenda.

Contribuição de Edison Mello. Parabéns Mello.

Acha todas as tabelas que são relacionadas com a FAT_CLIENTE.
SELECT
  parent.name TABELA, 
  child.name TABELA_FILHA, 
  foreigns.name NOME_FKey, 
  parent_columns.name COLUNA, 
  child_columns.name COLUNA_FILHA
FROM sys.tables parent 
INNER JOIN sys.foreign_keys foreigns 
  ON parent.[object_id] = foreigns.[referenced_object_id] 
INNER JOIN sys.tables child 
  ON child.[object_id] = foreigns.[parent_object_id] 
INNER JOIN sys.foreign_key_columns foreigns_columns 
  ON foreigns_columns.[constraint_object_id] = foreigns.[object_id] 
INNER JOIN sys.columns parent_columns 
  ON parent_columns.[object_id] = foreigns_columns.[parent_object_id] 
  AND parent_columns.[column_id] = foreigns_columns.[parent_column_id] 
INNER JOIN sys.columns child_columns 
  ON child_columns.[object_id] = foreigns_columns.[referenced_object_id] 
  AND child_columns.[column_id] = foreigns_columns.[referenced_column_id] 
WHERE parent.name = ‘FAT_CLIENTE’
ORDER BY TABELA, TABELA_FILHA

Lista as tabelas que não tem empresa e nem revenda

select DISTINCT a.name
from sys.tables a
inner join sys.columns b
  on a.object_id=b.object_id
where a.name not in (select DISTINCT a.name
        from sys.tables a
      inner join sys.columns b
      on a.object_id=b.object_id
      where b.name = ‘EMPRESA’)
and a.name not in (select DISTINCT a.name
        from sys.tables a
      inner join sys.columns b
      on a.object_id=b.object_id
         where b.name = ‘REVENDA’)
or a.name  in (select DISTINCT a.name
        from sys.tables a
      inner join sys.columns b
      on a.object_id=b.object_id
         where b.name = ‘REVENDA’
           and a.name not in (select DISTINCT a.name
                             from sys.tables a
                            inner join sys.columns b on a.object_id=b.object_id
                               where b.name = ‘EMPRESA’))
order by a.name;

Lista as tabelas que tem somente empresa

select DISTINCT a.name
from sys.tables a
inner join sys.columns b
  on a.object_id=b.object_id
where b.name = ‘EMPRESA’
and a.name not in (select DISTINCT a.name
        from sys.tables a
      inner join sys.columns b
      on a.object_id=b.object_id
         where b.name = ‘REVENDA’)
order by a.name                              

Lista as tabelas que tem empresa e revenda

select DISTINCT a.name
from sys.tables a
inner join sys.columns b
  on a.object_id=b.object_id
where b.name = ‘REVENDA’
and a.name not in (select DISTINCT a.name
        from sys.tables a
      inner join sys.columns b
      on a.object_id=b.object_id
         where b.name = ‘REVENDA’
           and a.name not in (select DISTINCT a.name
                             from sys.tables a
                            inner join sys.columns b on a.object_id=b.object_id
                               where b.name = ‘EMPRESA’))
order by a.name                               
 
Lista as constraints das tabelas

select t.name, f.name
FROM sys.tables t 
INNER JOIN sys.foreign_keys f
  ON t.[object_id] = f.[referenced_object_id]