Export (0) Print
Expand All

DataType Constructor (SqlDataType, Int32)

Initializes a new instance of the DataType class based on a specified SQL Server data type with specified precision or maximum length.

Namespace:  Microsoft.SqlServer.Management.Smo
Assembly:  Microsoft.SqlServer.Smo (in Microsoft.SqlServer.Smo.dll)

public DataType(
	SqlDataType sqlDataType,
	int precisionOrMaxLengthOrScale
)

Parameters

sqlDataType
Type: Microsoft.SqlServer.Management.Smo.SqlDataType
A SqlDataType object value that specifies the SQL Server data type.
precisionOrMaxLengthOrScale
Type: Int32
An Int32 value that specifies the precision for numeric SQL Server data types and maximum length for text based SQL Server data types.

Visual Basic

Dim dt As DataType
dt = New DataType(SqlDataType.

PowerShell

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

Community Additions

ADD
Show:
© 2014 Microsoft