Hi Chris,
I originally made the query in PostgreSQL with this piece of code to create PascalCase identifiers:
replace(initcap(replace(table_name,'_',' ')),' ','')
Just did a search to find a equivalent of initcab in SQL Server and found the replace variant.
Now the query builds an Anchor for a table that is a N:M table with attributes in a way that each FK results in a single Tie. It only generates binary Ties in this case.
I think a better approach is to build a tie for all the FK's combined and connect the Anchor to that Tie.
table1 -|--|< N:M table >|--|- table2wil transform in
Anchor(1) --1--< Tie >---n---- Anchor(N:M) Anchor(2) --1--< Tie >---n----/but a better way would be (I think)
Anchor(1) --n--/ n < way >--1-- Anchor(N:M)Anchor(2) --n-- Tie /If I have some spare time, I'll try to make a version that creates this construction.
Regards,
JJ.