The IsValidKeyDatatype method returns True when the data type specified can participate in a PRIMARY KEY or FOREIGN KEY constraint.
object.IsValidKeyDatatype( Type , [ ReferencingType ] )
Part | Description |
---|---|
object | Expression that evaluates to an object in the Applies To list. |
Type | String identifying a single base or user-defined data type by name. |
ReferencingType | Optional. A string identifying a second base or user-defined data type by name. |
True or False as described in Remarks.
When only the Type argument is used, the IsValidKeyDatatype method returns True when a column defined using the data type can participate in a PRIMARY KEY constraint.
When a second data type is specified in the ReferencingType argument, the IsValidKeyDatatype method returns True when the types are compatible. A True return value indicates that a column defined using one data type could reference a column defined using the other data type in a FOREIGN KEY constraint.
HRESULT IsValidKeyDatatype(
SQLDMO_LPCSTR szKeyColType,
LPBOOL pRetVal,
SQLDMO_LPCSTR szReferencingColType = NULL);