MaximumLength Property

SQL-DMO

SQL-DMO

MaximumLength Property

The MaximumLength property identifies the greatest length of a data type in bytes, or the precision of the type.

Applies To
SystemDatatype Object  
Syntax

object.MaximumLength

Parts

object

Expression that evaluates to an object in the Applies To list

Data Type

Long

Modifiable

Read-only

Prototype (C/C++)

HRESULT GetMaximumLength(LPLONG pRetVal);

Remarks

For binary and character data types, the MaximumLength property identifies the greatest number of bytes required to store a string of the type. For example, the SystemDatatype object referencing the varchar data type reports 8,000. The varchar data type can contain up to 8,000 bytes of data. The number of characters contained in the string is determined by the mix of single and multibyte characters within it.

For the fixed-precision, numeric data types, the MaximumLength property specifies the maximum precision of the type.

For all other referenced data types, the MaximumLength property identifies the number of bytes required to store a value of the type in a Microsoft® SQL Server™ 2000 structure representing the type.