hello everyone. i'm a newbie to ms sql but i understand the basics of adding tables and linking them. i have two tables tables that i have linked; Department and Employee. The Department table is the main table with a foreign key in the Employee table.
now from by basic understanding, if i'm to input data into the Department table and then input data in the Employee table, the foreign key 'Department_id' in the Employee table should automatically fill up, right?
well it keeps telling me that i can't leave that field null, but i can't manually fill in the data too. what am i doing wrong. can anyone help?
tryongliph
0
Light Poster
Recommended Answers
Jump to PostI dont use MS Sql anymore, but as far as I can remember the data will NOT be automatically inserted. You have to insert the data.
There has to be data in the table which references the foreign key, so in your case the department table has to have ā¦
All 2 Replies
Reply to this topic
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.