Share via


ColumnMaxLength Property

Diese Funktion wird in zukünftigen Versionen von Microsoft SQL Server nicht mehr bereitgestellt. Verwenden Sie diese Funktion beim Entwickeln neuer Anwendungen nicht, und planen Sie das Ändern von Anwendungen, in denen es zurzeit verwendet wird.

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.

Syntax

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

Hinweise

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: