码迷,mamicode.com
首页 > 其他好文 > 详细

查看同步Publication的方法 和 Article Identity column 自增属性

时间:2015-12-26 14:57:35      阅读:158      评论:0      收藏:0      [点我收藏+]

标签:

在Atricles Properties 中,能够查看同步Articles的属性

一,查看同步Table Article的方法

1,在New Publication Wizard的Articles 选项卡中,点击Articles Properties

技术分享

2,设置highlighted 选中的Table Article。

技术分享

 

3,在Statement delivery Catalog中,能够查看用于Insert,update 和 delete 语句对应的sp。

技术分享

 

Insert delivery format:指定如何将insert语句推送到subscriber,选中Call Stored Proedure是比较推荐的方式。

技术分享

技术分享

 

二,查看同步SP Article的方法

1,选中一个sp,设置SP Article的properties

技术分享

2,查看属性

技术分享

3,关键属性 Replicate

默认值是:Stored procedure definition only,是指只同步sp的definition。可以指定将sp的执行同步到subscription。

Specify that the execution of a stored procedure (rather than just its definition) should be published to the subscriber. The definition of the procedure (the CREATE PROCEDURE statement) is replicated to the Subscriber when the subscription is initialized; when the procedure is executed at the Publisher, replication executes the corresponding procedure at the Subscriber.

技术分享

技术分享

  • Execution of the stored procedure   
  • Execution in a serialized transaction of the SP                

"Execution in a serialized transaction of the SP" option is the recommended option, because it replicates the procedure execution only if the procedure is executed within the context of a serializable transaction. If the stored procedure is executed outside of a serializable transaction, changes to data in published tables are replicated as a series of data manipulation language (DML) statements.

 

三,Aritcle包含Identity column

如果Table Aritcle Table 包含Identity column,那么在Subscirber中,这个Identity column是保持和Publication值相同,还是重新生成新的ID,是由属性“not for replication ” 确定的。如果指定 “not for replication ”,那么Publication 和Subscription的ID column的值是相同的。

例如

CREATE TABLE [dbo].[dt_study]
(
    [id] [int] identity(1,1) not for replication NOT NULL PRIMARY KEY CLUSTERED  ,
    [name] [nvarchar](50) NULL,
    [sex] [bit] NULL
)


 

查看同步Publication的方法 和 Article Identity column 自增属性

标签:

原文地址:http://www.cnblogs.com/ljhdo/p/5077993.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!