在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 )