DataType.VarChar(Int32) DataType.VarChar(Int32) DataType.VarChar(Int32) Method

Definition

Returns an object that represents the specified type.

public:
 static Microsoft::SqlServer::Management::Smo::DataType ^ VarChar(int maxLength);
public static Microsoft.SqlServer.Management.Smo.DataType VarChar (int maxLength);
Public Shared Function VarChar (maxLength As Integer) As DataType
Parameters
maxLength
Int32 Int32 Int32

An Int32 value that specifies the maximum length of the data type.

Returns

Examples

Visual Basic

Dim dt As DataType  
dt = New DataType(SqlDataType.VarChar, 10)  

PowerShell

$dt = new-object Microsoft.SqlServer.Management.Smo.DataType([Microsoft.SqlServer.Management.Smo.SqlDataType]::VarChar, 10)  

Applies to