Type Property (Key) (SQL-DMO)

The Type property exposes configured attributes of the referenced Microsoft® SQL Server™ component.

Applies To

Key Object

Syntax

object.Type [= value]

Part Description
object Expression that evaluates to an object in the Applies To list
value Long integer specifying key constraint attributes as described in Settings

Settings
Constant Value Description
SQLDMOKey_Foreign 3 References, or will be used to create, a SQL Server FOREIGN KEY constraint
SQLDMOKey_Primary 1 References, or will be used to create, a SQL Server PRIMARY KEY constraint
SQLDMOKey_Unique 2 References a SQL Server UNIQUE key constraint on a table
SQLDMOKey_Unknown 0 Bad or invalid value

Data Type

Long, enumerated

Modifiable

Read/write when using the Key object to define a PRIMARY KEY or FOREIGN KEY constraint. Read-only when the Key object references an existing constraint.

Prototype (C/C++)

HRESULT GetType(SQLDMO_KEY_TYPE* pRetVal)

HRESULT SetType(SQLDMO_KEY_TYPE NewValue)

  


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