事务复制到不同的模式?
我有数据库 A 和数据库 B。我想从 A 到 B 进行单向复制。
唯一的问题是 [A].[dbo].[table]
需要复制到 [B].[someschema].[表]
。这容易吗(或可能做到)吗?关键要求是我有实时同步。我根本不需要转换 db B 中的表定义。
I have database A and database B. I would like to do one way replication from A to B.
The only hitch is [A].[dbo].[table]
needs to replicate to [B].[someschema].[table]
. Is this easy (or possible to do)? The key requirement is that I have real time synch. I do not need to transform the table definition at all in db B.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
简短的回答是,您可以做到这一点,但需要付出一些努力。
FROM BOOKS ONLINE:
架构和对象所有权
复制在新建发布向导中对于架构和对象所有权具有以下默认行为:
对于兼容性级别为 90 或更高的合并发布、快照发布和事务发布中的文章:默认情况下,订阅服务器上的对象所有者与发布服务器上相应对象的所有者相同。如果订阅服务器上不存在拥有对象的模式,则会自动创建它们。
对于兼容性级别低于 90 的合并发布中的文章:默认情况下,所有者保留为空,并在订阅服务器上创建对象期间指定为 dbo。
可以通过“文章属性 - ”对话框和以下存储过程来更改对象所有者:sp_addarticle、sp_addmergearticle、sp_changearticle 和 sp_changemergearticle。有关详细信息,请参阅
http://msdn.microsoft.com/en-us/库/ms151197.aspx
Short answer yes, you can do this, but not without some effort.
FROM BOOKS ONLINE:
Schemas and Object Ownership
Replication has the following default behavior in the New Publication Wizard with respect to schemas and object ownership:
For articles in merge publications with a compatibility level of 90 or higher, snapshot publications, and transactional publications: by default, the object owner at the Subscriber is the same as the owner of the corresponding object at the Publisher. If the schemas that own objects do not exist at the Subscriber, they are created automatically.
For articles in merge publications with a compatibility level lower than 90: by default, the owner is left blank and is specified as dbo during the creation of the object on the Subscriber.
The object owner can be changed through the Article Properties - dialog box and through the following stored procedures: sp_addarticle, sp_addmergearticle, sp_changearticle, and sp_changemergearticle. For more information, see
http://msdn.microsoft.com/en-us/library/ms151197.aspx