DTSBulkInsert_DataFileType 열거형

정의

원본 데이터를 제공하는 파일의 유형을 정의합니다.

public enum class DTSBulkInsert_DataFileType
public enum DTSBulkInsert_DataFileType
type DTSBulkInsert_DataFileType = 
Public Enum DTSBulkInsert_DataFileType
상속
DTSBulkInsert_DataFileType

필드

DTSBulkInsert_DataFileType_Char 0

문자 형식(기본값)입니다.

DTSBulkInsert_DataFileType_Native 1

네이티브(데이터베이스) 데이터 형식. bcp 유틸리티를 사용하여 SQL Server 데이터를 대량 복사하여 네이티브 데이터 파일을 만듭니다.

DTSBulkInsert_DataFileType_WideChar 2

유니코드 문자

DTSBulkInsert_DataFileType_WideNative 3

데이터를 유니코드로 저장하는 char, varchar 및 텍스트 열을 제외한 네이티브(데이터베이스) 데이터 형식입니다. bcp 유틸리티를 사용하여 SQL Server 데이터를 대량 복사하여 확대 데이터 파일을 만듭니다.

예제

다음 예제에서는 다음을 BulkInsertTask사용 하 여 TaskHost속성의 기본 설정을 보여 하며 만듭니다. 그런 다음 필드 값을 설정하는 방법을 보여주기 위해 이 열거형을 사용하는 필드 중 하나인 DataFileType두 개의 필드를 설정합니다.

using System;  
using System.Collections.Generic;  
using System.Text;  
using Microsoft.SqlServer.Dts.Runtime;  
using Microsoft.SqlServer.Dts.Tasks.BulkInsertTask;  

namespace Microsoft.SqlServer.SSIS.Samples  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
            Package pkg = new Package();  
            Executable exec1 = pkg.Executables.Add("STOCK:BulkInsertTask");  
            TaskHost th = exec1 as TaskHost;  

            // List the default values of the Bulk Insert task  
            // using the Properties collection of the TaskHost.  
            Console.WriteLine("BatchSize             {0}", th.Properties["BatchSize"].GetValue(th));  
            Console.WriteLine("CheckConstraints      {0}", th.Properties["CheckConstraints"].GetValue(th));  
            Console.WriteLine("CodePage              {0}", th.Properties["CodePage"].GetValue(th));  
            Console.WriteLine("DataFileType          {0}", th.Properties["DataFileType"].GetValue(th));  
            Console.WriteLine("DebugMode             {0}", th.Properties["DebugMode"].GetValue(th));  
            Console.WriteLine("DestinationConnection {0}", th.Properties["DestinationConnection"].GetValue(th));  
            Console.WriteLine("DestinationTableName  {0}", th.Properties["DestinationTableName"].GetValue(th));  
            Console.WriteLine("FieldTerminator       {0}", th.Properties["FieldTerminator"].GetValue(th));  
            Console.WriteLine("FireTriggers          {0}", th.Properties["FireTriggers"].GetValue(th));  
            Console.WriteLine("FirstRow              {0}", th.Properties["FirstRow"].GetValue(th));  
            Console.WriteLine("FormatFile            {0}", th.Properties["FormatFile"].GetValue(th));  
            Console.WriteLine("KeepIdentity          {0}", th.Properties["KeepIdentity"].GetValue(th));  
            Console.WriteLine("KeepNulls             {0}", th.Properties["KeepNulls"].GetValue(th));  
            Console.WriteLine("LastRow               {0}", th.Properties["LastRow"].GetValue(th));  
            Console.WriteLine("RowTerminator         {0}", th.Properties["RowTerminator"].GetValue(th));  
            Console.WriteLine("SortedData            {0}", th.Properties["SortedData"].GetValue(th));  
            Console.WriteLine("SourceConnection      {0}", th.Properties["SourceConnection"].GetValue(th));  
            Console.WriteLine("SqlStatement          {0}", th.Properties["SqlStatement"].GetValue(th));  
            Console.WriteLine("SuspendRequired       {0}", th.Properties["SuspendRequired"].GetValue(th));  
            Console.WriteLine("TableLock             {0}", th.Properties["TableLock"].GetValue(th));  
            Console.WriteLine("UseFormatFile         {0}", th.Properties["UseFormatFile"].GetValue(th));  

            Console.WriteLine("--------------------------");  
            // Show how to set a property using the TaskHost Properties.  
            th.Properties["CheckConstraints"].SetValue(th, true);  
            th.Properties["DataFileType"].SetValue(th, DTSBulkInsert_DataFileType.DTSBulkInsert_DataFileType_Native);  
            Console.WriteLine("New value of CheckConstraints and DataFileType:  {0}, {1}", th.Properties["CheckConstraints"].GetValue(th), th.Properties["DataFileType"].GetValue(th));  
        }  
    }  
}  
Imports System  
Imports System.Collections.Generic  
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime  
Imports Microsoft.SqlServer.Dts.Tasks.BulkInsertTask  

Namespace Microsoft.SqlServer.SSIS.Samples  
    Class Program  
        Shared  Sub Main(ByVal args() As String)  
            Dim pkg As Package =  New Package()   
            Dim exec1 As Executable =  pkg.Executables.Add("STOCK:BulkInsertTask")   
            Dim th As TaskHost =  exec1 as TaskHost   

            ' List the default values of the Bulk Insert task  
            ' using the Properties collection of the TaskHost.  
            Console.WriteLine("BatchSize             {0}", th.Properties("BatchSize").GetValue(th))  
            Console.WriteLine("CheckConstraints      {0}", th.Properties("CheckConstraints").GetValue(th))  
            Console.WriteLine("CodePage              {0}", th.Properties("CodePage").GetValue(th))  
            Console.WriteLine("DataFileType          {0}", th.Properties("DataFileType").GetValue(th))  
            Console.WriteLine("DebugMode             {0}", th.Properties("DebugMode").GetValue(th))  
            Console.WriteLine("DestinationConnection {0}", th.Properties("DestinationConnection").GetValue(th))  
            Console.WriteLine("DestinationTableName  {0}", th.Properties("DestinationTableName").GetValue(th))  
            Console.WriteLine("FieldTerminator       {0}", th.Properties("FieldTerminator").GetValue(th))  
            Console.WriteLine("FireTriggers          {0}", th.Properties("FireTriggers").GetValue(th))  
            Console.WriteLine("FirstRow              {0}", th.Properties("FirstRow").GetValue(th))  
            Console.WriteLine("FormatFile            {0}", th.Properties("FormatFile").GetValue(th))  
            Console.WriteLine("KeepIdentity          {0}", th.Properties("KeepIdentity").GetValue(th))  
            Console.WriteLine("KeepNulls             {0}", th.Properties("KeepNulls").GetValue(th))  
            Console.WriteLine("LastRow               {0}", th.Properties("LastRow").GetValue(th))  
            Console.WriteLine("RowTerminator         {0}", th.Properties("RowTerminator").GetValue(th))  
            Console.WriteLine("SortedData            {0}", th.Properties("SortedData").GetValue(th))  
            Console.WriteLine("SourceConnection      {0}", th.Properties("SourceConnection").GetValue(th))  
            Console.WriteLine("SqlStatement          {0}", th.Properties("SqlStatement").GetValue(th))  
            Console.WriteLine("SuspendRequired       {0}", th.Properties("SuspendRequired").GetValue(th))  
            Console.WriteLine("TableLock             {0}", th.Properties("TableLock").GetValue(th))  
            Console.WriteLine("UseFormatFile         {0}", th.Properties("UseFormatFile").GetValue(th))  

            Console.WriteLine("--------------------------")  
            ' Show how to set a property using the TaskHost Properties.  
            th.Properties("CheckConstraints").SetValue(th, True)  
            th.Properties("DataFileType").SetValue(th, DTSBulkInsert_DataFileType.DTSBulkInsert_DataFileType_Native)  
            Console.WriteLine("New value of CheckConstraints and DataFileType:  {0}, {1}", th.Properties("CheckConstraints").GetValue(th), th.Properties("DataFileType").GetValue(th))  

        End Sub  
    End Class  
End Namespace  

샘플 출력:

BatchSize 0

CheckConstraints False

CodePage RAW

DataFileType 0

DebugMode False

DestinationConnection

DestinationTableName

FieldTerminator 탭

FireTriggers False

FirstRow 1

FormatFile

KeepIdentity False

KeepNulls False

LastRow 0

MaximumErrors 0

RowTerminator {CR}{LF}

SortedData

SourceConnection

SqlStatement System.String[]

SuspendRequired False

TableLock False

UseFormatFile False

--------------------------

CheckConstraints 및 DataFileType의 새 값: True, 1

설명

대량 삽입 작업은 대량의 데이터를 SQL Server 테이블 또는 뷰에 복사하는 가장 빠른 방법을 제공합니다. 자세한 내용은 대량 삽입 태스크bcp 유틸리티를 참조하세요.

적용 대상