次の方法で共有


ColumnMaxLength Property

この機能は、将来のバージョンの Microsoft SQL Server では削除される予定です。 新しい開発作業では、この機能の使用を避け、現在この機能を使用しているアプリケーションは修正するようにしてください。

The ColumnMaxLength property exposes the maximum number of characters required to store the data of a column in the current result set of a QueryResults object.

構文

object.ColumnMaxLength(OrdinalColumn)

Parts

  • object
    An expression that evaluates to an object in the Applies To list.

  • OrdinalColumn
    A long integer that specifies the column in the results by position.

Data Type

String

Modifiable

Read-only

Prototype (C/C++)

HRESULT GetColumnMaxLength(long nColumn, LPLONG pRetVal);

説明

Interpret the value of the ColumnMaxLength property with respect to the data type of the column in the result set. Retrieve the data type using the ColumnType property.

ColumnType property

ColumnMaxLength

SQLDMO_DTypeBinary, SQLDMO_DTypeGUID, SQLDMO_DTypeImage, SQLDMO_DTypeNText, SQLDMO_DTypeText, or SQLDMO_DTypeVarBinary

A system-defined value. Use the GetColumnBinaryLength method to determine the length of a specified row value.

SQLDMO_DTypeBit, SQLDMO_DTypeFloat8, SQLDMO_DTypeInt1, SQLDMO_DTypeInt2, SQLDMO_DTypeInt4, SQLDMO_DTypeMoney, or SQLDMO_DTypeMoney4

The maximum precision of a value of the type.

SQLDMO_DTypeChar, SQLDMO_DTypeVarchar, SQLDMO_DTypeUChar, or SQLDMO_DTypeUVarchar

The count of bytes required to represent the data as a Unicode character string (two bytes per character). The count is incremented to include the count of bytes in a string terminator.

SQLDMO_DTypeDateTime or SQLDMO_DTypeDateTime4

A system-defined value.

Applies To: