Home

Primary and Secondary tables, need help with relationship for auto create/update

%3CLINGO-SUB%20id%3D%22lingo-sub-1181091%22%20slang%3D%22en-US%22%3EPrimary%20and%20Secondary%20tables%2C%20need%20help%20with%20relationship%20for%20auto%20create%2Fupdate%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1181091%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20everyone!%20I'm%20getting%20into%20the%20weeds%20with%20a%20database%20i'm%20trying%20to%20update%20and%20could%20really%20use%20your%20help.%20Due%20to%20storage%20limits%20in%20the%20tables%2C%20i%20need%20to%20split%20the%20data%20and%20uploads%20into%20two%20tables.%20Both%20are%20classified%20by%20their%20respective%20%22Case%20%23%22%20which%20i%20use%20as%20a%20primary%20key%20for%20both.%20I%20have%20been%20trying%20but%20can't%20seem%20to%20find%20a%20way%20for%20the%20primary%20table's%20Primary%20Key%20to%20auto%20populate%20into%20the%20secondary's%20Primary%20Key%20for%20each%20case.%20For%20example%2C%20if%20case%20%23%20114%20is%20created%20in%20the%20primary%20table%2C%20i%20need%20case%20%23%20114%20to%20auto%20create%2Fpopulate%20into%20the%20secondary%20table%20so%20i%20can%20enter%20metrics%2Fvalues%20in%20the%20primary%20table%20and%20upload%20files%20into%20the%20secondary%20table%20under%20the%20same%20case%20%23.%20I've%20tried%20using%20the%20Relationships%20with%20Referential%20integrity%20and%20cascading%20updates%2Fdeletes%20between%20the%20two%20tables%20primary%20keys%20(the%20Case%20%23)%2C%20but%20that%20doesn't%20seem%20to%20work.%20Is%20this%20possible%3F%20If%20so%2C%20what%20am%20i%20doing%20wrong%3F%20And%20if%20it's%20impossible%2C%20what%20can%20i%20do%20to%20get%20the%20desired%20effect%3F%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThank%20you%20all%20for%20your%20time.%3C%2FP%3E%3CP%3E-Ray%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1181091%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EAccess%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1182311%22%20slang%3D%22en-US%22%3ERe%3A%20Primary%20and%20Secondary%20tables%2C%20need%20help%20with%20relationship%20for%20auto%20create%2Fupdate%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1182311%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F562784%22%20target%3D%22_blank%22%3E%40Ray_Barrit%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3EUnfortunately%2C%20your%20description%20suggests%20an%20invalid%2C%20or%20inappropriate%2C%20table%20design.%20It%20sounds%20like%20you%20have%20what%20is%20often%20referred%20to%20as%20a%20%22spreadsheet%20style%22%20table%2C%20not%20a%20set%20of%20relational%20database%20tables.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHere's%20%3CA%20href%3D%22https%3A%2F%2Frogersaccessblog.blogspot.com%2Fsearch%2Flabel%2FProblems%2520With%2520Repeated%2520Columns%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ean%20excellent%20set%20of%20blog%20posts%3C%2FA%3E%20that%20explain%20the%20problem%20and%20offer%20ways%20to%20correct%20it.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20don't%20think%20it's%20a%20good%20idea%2C%20by%20the%20way%2C%20to%20offer%20you%20suggestions%20about%20working%20with%20this%20table%20design%2C%20even%20if%20it%20could%20be%20done%20without%20a%20wad%20of%20code.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1189802%22%20slang%3D%22en-US%22%3ERe%3A%20Primary%20and%20Secondary%20tables%2C%20need%20help%20with%20relationship%20for%20auto%20create%2Fupdate%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1189802%22%20slang%3D%22en-US%22%3EThanks%2C%20I'll%20take%20a%20look%20at%20those%20threads%20and%20see%20what%20i%20can%20do!%20It's%20definitely%20a%20spreadsheet%20style%20table%2C%20mostly%20to%20have%20an%20easy%20data%20export%20to%20excel.%20There's%20simply%20too%20many%20values%2Fcolumns%20for%20a%20single%20table%2C%20so%20that's%20why%20I%20was%20looking%20into%20a%20secondary%20extension.%3CBR%20%2F%3E%3CBR%20%2F%3EThanks%20again!%3CBR%20%2F%3E%3CBR%20%2F%3E-Ray%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1189903%22%20slang%3D%22en-US%22%3ERe%3A%20Primary%20and%20Secondary%20tables%2C%20need%20help%20with%20relationship%20for%20auto%20create%2Fupdate%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1189903%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F562784%22%20target%3D%22_blank%22%3E%40Ray_Barrit%3C%2FA%3E%26nbsp%3BWhile%20it%20is%20true%20that%20tables%20in%20a%20normalized%20relational%20database%20application%20tend%20to%20have%20fewer%20columns%20in%20each%20table%2C%20that%20is%20a%20RESULT%20of%20the%20normalization%20process%3B%20it%20is%20not%20the%20goal%20in%20itself.%3C%2FP%3E%3CP%3E%22%3CSPAN%3EThere's%20simply%20too%20many%20values%2Fcolumns%20for%20a%20single%20table%22%20In%20other%20words%2C%20we%20have%20a%20principled%20process%20to%20reduce%20that%20number%20of%20columns.%20That%20process%2C%20called%20%22normalization%22%2C%20is%20based%20on%20understanding%20RELATIONSHIPS%20between%20entities.%20When%20you%20do%20it%20that%20way%2C%20the%20natural%20outcome%20will%20be%20more%20tables%20with%20fewer%20fields.%20But%2C%20to%20repeat%20myself%20a%20bit%2C%20that's%20NOT%20the%20goal%20in%20and%20of%20itself.%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

Hi everyone! I'm getting into the weeds with a database i'm trying to update and could really use your help. Due to storage limits in the tables, i need to split the data and uploads into two tables. Both are classified by their respective "Case #" which i use as a primary key for both. I have been trying but can't seem to find a way for the primary table's Primary Key to auto populate into the secondary's Primary Key for each case. For example, if case # 114 is created in the primary table, i need case # 114 to auto create/populate into the secondary table so i can enter metrics/values in the primary table and upload files into the secondary table under the same case #. I've tried using the Relationships with Referential integrity and cascading updates/deletes between the two tables primary keys (the Case #), but that doesn't seem to work. Is this possible? If so, what am i doing wrong? And if it's impossible, what can i do to get the desired effect??

 

Thank you all for your time.

-Ray

 

3 Replies
Highlighted

@Ray_Barrit 

Unfortunately, your description suggests an invalid, or inappropriate, table design. It sounds like you have what is often referred to as a "spreadsheet style" table, not a set of relational database tables.

 

Here's an excellent set of blog posts that explain the problem and offer ways to correct it.

 

I don't think it's a good idea, by the way, to offer you suggestions about working with this table design, even if it could be done without a wad of code.

Highlighted
Thanks, I'll take a look at those threads and see what i can do! It's definitely a spreadsheet style table, mostly to have an easy data export to excel. There's simply too many values/columns for a single table, so that's why I was looking into a secondary extension.

Thanks again!

-Ray
Highlighted

@Ray_Barrit While it is true that tables in a normalized relational database application tend to have fewer columns in each table, that is a RESULT of the normalization process; it is not the goal in itself.

"There's simply too many values/columns for a single table" In other words, we have a principled process to reduce that number of columns. That process, called "normalization", is based on understanding RELATIONSHIPS between entities. When you do it that way, the natural outcome will be more tables with fewer fields. But, to repeat myself a bit, that's NOT the goal in and of itself.