English 中文(简体)
实体框架/SQL 服务器 关键
原标题:Entity Framework/SQL Server Many Foreign Keys

I m trying to decide on table design when working with Entity Framework and SQL Server.

我有一个与许多其他实体(约15个)有关的单一实体(通讯)。

我也可以在非行中设立15个可撤销的FK栏,或建立一个单一的、无约束的栏目(EntityPrimaryKey)和一个实体Type栏,以跟踪实体财产栏目的价值。

What issues might I have with these two different designs? Opinions on which is better?

最佳回答

<>Always使用real外国钥匙,这些钥匙可用于强制执行参考完整性。

这种“确定关键类型的关键一栏和一栏”可能首先像好主意一样,但归根结底,由于你不能确立任何参考性的完整性,它实际上毫无意义。

随着时间的推移,你把“zombie”儿童行走到更不用提的表格中。 而数据的质量和完整性是我的良好数据库设计的最重要方面——始终确保你的数据的完整性是铁cl——任何其他东西都背后这一要求!

问题回答

暂无回答




相关问题
Export tables from SQL Server to be imported to Oracle 10g

I m trying to export some tables from SQL Server 2005 and then create those tables and populate them in Oracle. I have about 10 tables, varying from 4 columns up to 25. I m not using any constraints/...

SQL server: Can NT accounts be mapped to SQL server accounts

In our database we have an SQL server account that has the correct roles to access some of the databases. We are now switching to windows authentication and I was wondering if we can create a NT user ...

SQL Server 2000, ADO 2.8, VB6

How to determine if a Transaction is active i.e. before issuing Begin Transaction I want to ensure that no previous transaction are open.. the platform is VB6, MS-SQL Server 2000 and ADO 2.8

热门标签