Partager via


ColumnMaxLength Property

Cette fonctionnalité sera supprimée dans une prochaine version de Microsoft SQL Server. Évitez d'utiliser cette fonctionnalité dans de nouveaux travaux de développement et prévoyez de modifier les applications qui utilisent actuellement cette fonctionnalité.

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.

Syntaxe

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);

Notes

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: