TechNet
Export (0) Print
Expand All

DataType Constructor (SqlDataType, Int32, Int32)

 

Initializes a new instance of the DataType class based on a specified SQL Server data type with the specified precision and scale.

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

public DataType(
	SqlDataType sqlDataType,
	int precision,
	int scale
)

Parameters

sqlDataType
Type: Microsoft.SqlServer.Management.Smo.SqlDataType

A SqlDataType object value that specifies the SQL Server data type.

precision
Type: System.Int32

An Int32 value that specifies the precision for numeric SQL Server data types.

scale
Type: System.Int32

An Int32 value that specifies the scale for numeric SQL Server data types.

Visual Basic

'Declare and create a DataType object variable.
Dim dt As DataType
dt = New DataType(SqlDataType.Decimal, 3, 3)

PowerShell

$dt = new-object Microsoft.SqlServer.Management.Smo.DataType([Microsoft.SqlServer.Management.Smo.SqlDataType]::Decimal, 3, 3)
Return to top
Show:
© 2016 Microsoft