Compartir a través de


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.

Espacio de nombres:  Microsoft.SqlServer.Management.Smo
Ensamblado:  Microsoft.SqlServer.Smo (en Microsoft.SqlServer.Smo.dll)

Sintaxis

'Declaración
Public Sub New ( _
    sqlDataType As SqlDataType, _
    precision As Integer, _
    scale As Integer _
)
'Uso
Dim sqlDataType As SqlDataType
Dim precision As Integer
Dim scale As Integer

Dim instance As New DataType(sqlDataType, _
    precision, scale)
public DataType(
    SqlDataType sqlDataType,
    int precision,
    int scale
)
public:
DataType(
    SqlDataType sqlDataType, 
    int precision, 
    int scale
)
new : 
        sqlDataType:SqlDataType * 
        precision:int * 
        scale:int -> DataType
public function DataType(
    sqlDataType : SqlDataType, 
    precision : int, 
    scale : int
)

Parámetros

Ejemplos

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)