I have the following design:
Table1
|----------|
|ID |
|Text |
|----------|
Main Table2
|-------| |----------|
|Table | |ID |
|ID | |Text |
|-------| |----------|
Table3
|----------|
|ID |
|Text |
|----------|
Table4
|----------|
|ID |
|Text |
|----------|
Where main contains the tablename (i.e. table1) and the ID number corresponding to the text in the relevant table
I cannot flaten the tables down as they are in a hierarchy.
The problem with this approach is that I cannot join the Main table to the other tables without resorting to dynamic SQL, and ideally I would like to use a view.
Anybody think of a better design? Maybe another table in between, but what?
Table1
|----------|
|ID |
|Text |
|----------|
Main Table2
|-------| |----------|
|Table | |ID |
|ID | |Text |
|-------| |----------|
Table3
|----------|
|ID |
|Text |
|----------|
Table4
|----------|
|ID |
|Text |
|----------|
Where main contains the tablename (i.e. table1) and the ID number corresponding to the text in the relevant table
I cannot flaten the tables down as they are in a hierarchy.
The problem with this approach is that I cannot join the Main table to the other tables without resorting to dynamic SQL, and ideally I would like to use a view.
Anybody think of a better design? Maybe another table in between, but what?