Is there a straightforward way to determine the cardinality of a foreign key relationship using SMO?
-
29-10-2019 - |
Pergunta
Using SMO
, I'm trying to determine the cardinality of ForeignKey
relationships between tables in a SQL Server database. I could peruse each ForeignKeyColumn
and look at each Column
in the parent (and possibly also referenced) Table
s, and look at the nullability of those columns as well as cross referencing with related Index
es to determine cardinality (multiplicity on each end such as 0..1
, 1
, *
) as illustrated by the following entity-relationship diagram:
But, there should be a more straightforward way to do this. I don't see any relevant information in the ForeignKey
Properties
or ExtendedProperties
. The only item I could find in the MSDN Library was an SfcCardinality enumeration, which states "Do not reference this member directly in your code. It supports the SQL Server infrastructure.".
Is there a straight forward way to get cardinality information via SMO?
Nenhuma solução correta