IS_A关系主键验证规则 [英] IS_A relationship primary key validation rules

查看:116
本文介绍了IS_A关系主键验证规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,我正在为访问中的警察局建立数据库。我有一个报告超类,它分为几个子类。从我的书中告诉我,超级类应该是带有 ID的主键,

应将ID传递到子类上,以确保没有2个具有相同ID的子类。如果该ID不存在,如何制定验证规则以不允许创建新的子分类报告?其他子类正在使用

So I am building a database for a police station in access. I have a reports super-class that is divided into several sub-classes.From what my books tell me the supper-class should be the one with the "ID" that is the primary key
and that the ID should be passed onto the sub classes so that there are no 2 sub-classes with the same ID .How do I make a validation rule that doesn't allow to make a new sub-clas report if that ID doesn't exists or is being used by other sub classes

推荐答案

在表中插入无法检查主键是否存在于另一个子表中表,除了通过业务规则或使用数据库触发器强制此约束。
您需要再次分析数据库模型,并尝试确定一个好的设计。

There is no way insertion in a table can check whether that primary key is present in another table apart from either forcing this constraint through business rule or by using DB Trigger. You need to analyse your DB Model again and try to identify a good design.

这篇关于IS_A关系主键验证规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆