HasPrimaryKey Property (SQL-DMO)

The HasPrimaryKey property returns True if the referenced table has a PRIMARY KEY constraint defined on a column.

Applies To

ReplicationTable Object

Syntax

object.HasPrimaryKey

Part Description
object Expression that evaluates to an object in the Applies To list

Remarks

Transactional replication requires a primary key to identify rows. For SQL Server installations, primary keys are implemented in PRIMARY KEY and UNIQUE key constraints.

If True, the table contains a PRIMARY KEY constraint and can be published as an article in a  transactional publication.

If False, the table does not contain support for transactional replication and cannot be published as a transactional article.

Data Type

Boolean

Modifiable

Read-only

Prototype (C/C++)

HRESULT GetHasPrimaryKey(LPBOOL pRetVal);

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.