ReplicationTable.HasPrimaryKey 屬性

定義

取得值,指出資料表是否有主索引鍵。

public:
 property bool HasPrimaryKey { bool get(); };
public bool HasPrimaryKey { get; }
member this.HasPrimaryKey : bool
Public ReadOnly Property HasPrimaryKey As Boolean

屬性值

Boolean

如果資料表有主索引鍵則為 true,如果資料表沒有主索引鍵則為 false

備註

異動複寫需要主鍵來識別資料列。 如果其中一個資料行上有主鍵條件約束,則資料表可以發行為交易式發行集以及快照集和合併式發行集中的發行項。 如果資料表上沒有 primary key 條件約束,就無法在交易式發行集中發行此資料表。

HasPrimaryKey屬性可以由發行者端系統管理員(sysadmin)固定伺服器角色的成員或發行集資料庫上的 db_owner 固定資料庫角色的成員來抓取。

適用於