DataType.UserDefinedTableType 메서드 (String)

Returns an object that represents the specified type.

네임스페이스:  Microsoft.SqlServer.Management.Smo
어셈블리:  Microsoft.SqlServer.Smo(Microsoft.SqlServer.Smo.dll)

구문

‘선언
Public Shared Function UserDefinedTableType ( _
    type As String _
) As DataType
‘사용 방법
Dim type As String 
Dim returnValue As DataType 

returnValue = DataType.UserDefinedTableType(type)
public static DataType UserDefinedTableType(
    string type
)
public:
static DataType^ UserDefinedTableType(
    String^ type
)
static member UserDefinedTableType : 
        type:string -> DataType
public static function UserDefinedTableType(
    type : String
) : DataType

매개 변수

반환 값

유형: Microsoft.SqlServer.Management.Smo.DataType
A DataType object value.

The following code example shows how to create a user-defined table type.

C#

Server srv = new Server("(local)");
Database db = srv.Databases["AdventureWorks2012"];
Schema schema1 = new Schema(db, "ExampleSchema");
schema1.Create();
UserDefinedTableType udtt = new UserDefinedTableType(db, "udtt", "ExampleSchema");
Column c = new Column(udtt, "Column 1", DataType.Int);
udtt.Columns.Add(c);
udtt.Create();
DataType userTable = new DataType(SqlDataType.UserDefinedTableType, "udtt");
userTable.Schema = "ExampleSchema";

Powershell

$srv = new-object Microsoft.SqlServer.Management.Smo.Server("(local)")
$db = $srv.Databases.Item("AdventureWorks2012")
$schema1 = new-object Microsoft.SqlServer.Management.Smo.Schema($db, "ExampleSchema")
$schema1.Create()
$udtt = new-object Microsoft.SqlServer.Management.Smo.UserDefinedTableType($db, "udtt", "ExampleSchema")
$c = new-object Microsoft.SqlServer.Management.Smo.Column($udtt, "Column 1", [Microsoft.SqlServer.Management.Smo.DataType]::Int)
$udtt.Columns.Add($c)
$udtt.Create()
$userTable = new-object Microsoft.SqlServer.Management.Smo.DataType([Microsoft.SqlServer.Management.Smo.SqlDataType]::UserDefinedTableType, "udtt")
$userTable.Schema = "ExampleSchema"

참고 항목

참조

DataType 클래스

UserDefinedTableType 오버로드

Microsoft.SqlServer.Management.Smo 네임스페이스

관련 자료

데이터 형식 사용