在复制的数据库上确保引用完整性的最佳方法是什么? [英] What's the best way to ensure referential integrity on a replicated database?

查看:113
本文介绍了在复制的数据库上确保引用完整性的最佳方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用SQL SERVER 2005,我对复制和引用完整性有一些疑问。

Using SQL SERVER 2005, I have a couple of questions on Replication and referential integrity.

1)复制是否处理引用完整性?

1) Does Replication handle referential integrity?

2)如果在源DB上的一个事务中执行插入到父表然后插入插入到子表,则复制DB是否也会以相同的方式运行?即在子表中引用它之前,必须在主表中存在复制的数据库记录?

2) If I do an Insert to Parent table and then to Insert to Child table, in one transaction, on Source DB - will Replicated DB also behave in the same manner? I.e. In Replicated DB record must be present in Master table, before it is referenced in child table?

谢谢

推荐答案

假定复制是事务性的,并且您具有参照完整性在您的发布者上,那么所有订阅者都将保持同步,因此将保持参照完整性。插入顺序是一致的。

Assuming replication is transactional and you have referential integrity on your publisher, then any subscribers will be in sync and therefore referential integrity will be maintained. The order of inserts is consistent.

这篇关于在复制的数据库上确保引用完整性的最佳方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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