I have table named ‘Dictionary’ with columns as follow:
- ID bigint
- TYPE varchar (200)
- ITEM varchar (200)
Table is used by various tables as simple dictionary / lookup.
Eg it stores countries, titles, business type lists.
TYPE column keeps info about type of dictionary , ITEM is dictionary string value.
All works well but I have problem to set up relationship between dictionary and foreigin tables.
When I’m using ‘Foreign Key Relationship’ I can not make it depended of ‘TYPE” column.
(Please note same item with same type – eg ‘countries’ can be linked to several tables, when item with another type can be linked to different)
Currently I’m using USPs to manage that but I’d like to switch to standard relationship mechanism.
Any advice how to get that?
It looks to me that you could consider an alternative design
and then make links to the ID of DictionaryType table in places where you currently want to reference Type field from your original design