开发者

Normalized Database Question

开发者 https://www.devze.com 2023-01-10 08:51 出处:网络
I should know开发者_如何学Python this but I expect it to be a simple answer... This is my simple database so far for this 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:

Normalized Database 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消