Normalized Database Question
I should know开发者_如何学Python this but I expect it to be a simple answer...
This is my simple database so far for this question:
Am I supposed to insert the Id from Contact and Phone into Contact_Phone when I insert a record into Contact and Phone tables - or can this be done automatically?
I am using SQL Server 2008 Express.
You have to insert it yourself in SQL, but it depends entirely on how you're accessing the database.
The Entity Framework should be able to handle this for you automatically.
You need to insert it. And since the relationships are defined, you will need to insert it into the Contact and Phone tables first.
How could the database know which contacts and phones go together unless you insert them? Unfortunately in SQL Server you can't update more than one table at once - a limitation shared by most if not all SQL DBMSs.
精彩评论