DTSBulkInsert_DataFileType 列挙型
定義
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
ソースデータを提供するファイルの種類を定義します。
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 | ネイティブ (データベース) データ型。 SQL Serverからbcpユーティリティを使ってデータを一括コピーしてネイティブデータファイルを作成します。 |
| DTSBulkInsert_DataFileType_WideChar | 2 | Unicode 文字。 |
| DTSBulkInsert_DataFileType_WideNative | 3 | ネイティブ(データベース)データ型ですが、char、varchar、テキスト列はUnicodeとしてデータを格納します。 bcpユーティリティを使ってSQL Serverからデータを一括コピーしてワイドネイティブデータファイルを作成します。 |
例
以下の例では BulkInsertTaskを作成し、プロパティのデフォルト設定を TaskHostを使って示します。 次に2つのフィールドを設定し、そのうちの1つは 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
出力例:
バッチサイズ0
CheckConstraints False
コードページRAWです
DataFileType 0
DebugMode False
デスティネーションコネクション
DestinationTableName
FieldTerminator タブ
FireTriggers False
ファーストロウ1
フォーマットファイル
アイデンティティを偽りに保つ
Nulls を偽りに保つ
ラストロウ 0
MaximumErrors 0
RowTerminator {CR}{LF}
ソーテッドデータ
出典接続
SqlStatement System.String[]
停止必須の虚偽
TableLockの誤り
UseFormatFile False
--------------------------
CheckConstraintsとDataFileTypeの新しい値:True、1
注釈
バルクインサートタスクは、大量のデータをSQL Serverのテーブルやビューにコピーする最速の方法を提供します。 詳細については、 Bulk Insert Task および bcp Utilityをご覧ください。