다음을 통해 공유


IsValidKeyDatatype Method

Microsoft SQL Server의 이후 버전에서는 이 기능이 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 말고, 현재 이 기능을 사용하는 응용 프로그램은 수정하십시오.

The IsValidKeyDatatype method returns TRUE when the data type specified can participate in a PRIMARY KEY or FOREIGN KEY constraint.

구문

object
.IsValidKeyDatatype(
Type 
, [ ReferencingType ] )

Parts

  • object
    Expression that evaluates to an object in the Applies To list.
  • Type
    String that identifies a single base or user-defined data type by name.
  • ReferencingType
    Optional. A string that identifies a second base or user-defined data type by name.

Prototype (C/C++)

HRESULT IsValidKeyDatatype(
SQLDMO_LPCSTR szKeyColType,
LPBOOL pRetVal,
SQLDMO_LPCSTR szReferencingColType = NULL);

Returns

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.

Applies To:

Database Object