Excelソースは、Microsoft Excelのワークブックからデータを抽出するための機能です。データアクセスモードは、テーブル、変数で指定されたテーブル、自動SQL文、変数に保存されたSQL文の4種類があります。Excelコネクションマネージャーを使用して、データソースに接続します。通常の出力とエラー出力があり、SSISデザイナーまたはプログラム的にプロパティを設定できます。エラー処理オプションを選択し、エラー発生時の動作を設定します。Excelソースエディタでの設定により、データのマッピングが可能です。
SQL Server と Azure Data Factory における Excel ソース
適用対象
- SQL Server
- Azure Data Factory の SSIS インテグレーションランタイム
Excel ソースは、Microsoft Excel ワークブック内のワークシートや範囲からデータを抽出します。
アクセスモード
Excel ソースでは、データを抽出するために4つの異なるデータアクセスモードを提供しています。
- テーブルまたはビュー
- 変数で指定されたテーブルまたはビュー
- SQL 文の結果(パラメータ化クエリも可能)
- 変数に格納されたSQL文の結果
Excel ソースは、Excel コネクション マネージャーを使用してデータソースに接続し、使用するワークブックファイルを指定します。詳しくは、Excel コネクションマネージャーを参照してください。また、Excel ソースには通常の出力とエラー出力が1つあります。
Excel ソースの構成
SSIS デザイナーまたはプログラムでプロパティを設定できます。
Advanced Editor ダイアログボックスでは、プログラムで設定できるすべてのプロパティが反映されます。詳細については、次のトピックのいずれかをクリックしてください。
Excel ファイルのグループをループする方法については、Foreach Loop Container を使用して Excel ファイルとテーブルをループするを参照してください。
Excel ソースエディタ(接続マネージャーページ)
Excel ソースエディタ ダイアログボックスの Connection Manager ノードを使用して、ソースに使用する Microsoft Excel ワークブックを選択します。このソースは、既存のワークブック内のワークシートや名前付き範囲からデータを読み取ります。
注意
CommandTimeout プロパティは Excel ソースエディタ では利用できませんが、Advanced Editor を使用することで設定できます。このプロパティの詳細については、Excel カスタムプロパティを参照してください。
静的オプション
-
OLE DB コネクションマネージャー
リストから既存の Excel コネクションマネージャーを選択するか、新しいコネクションを作成します。 - データアクセスモード
ソースからデータを選択する方法を指定します。
値 | 説明 |
---|---|
テーブルまたはビュー | Excel ファイルのワークシートまたは名前付き範囲からデータを取得します。 |
テーブル名またはビュー名変数 | 変数にワークシートや範囲の名前を指定します。 |
SQL コマンド | SQL クエリを使用して Excel ファイルからデータを取得します。 |
変数からの SQL コマンド | 変数に格納された SQL クエリテキストを指定します。 |
プレビュー
Data View ダイアログボックスを使用して、結果を最大200行までプレビューできます。
Excel ソースエディタ(列ページ)
Excel ソースエディタ ダイアログボックスの Columns ページを使用して、出力列を各外部(ソース)列にマッピングします。
オプション
利用可能な外部列
データソースに存在する利用可能な外部列のリストを表示します。このテーブルを使用して列を追加または削除することはできません。
外部列
タスクが読み取る順序で外部(ソース)列を表示します。外部列の選択を解除し、別の順序で外部列をリストから選択することでこの順序を変更できます。
エラー出力ページ
エラー出力ページでは、エラー処理オプションを選択し、エラー出力列のプロパティを設定します。
オプション
- 入力または出力
データソースの名前を表示します。 - 列
Excel ソースエディタの接続マネージャーページで選択した外部(ソース)列を表示します。 - エラー
エラーが発生したときに何が起こるかを指定します(無視、行をリダイレクト、またはコンポーネントを失敗させる)。
関連コンテンツ
これらの情報を活用して、Excel からデータを効果的に処理してください。
————-
Excel Source – SQL Server Integration Services (SSIS)
Source link
Overview of Excel Source in SSIS for SQL Server and Azure Data Factory
The Excel source in SQL Server Integration Services (SSIS) allows data extraction from Microsoft Excel worksheets or ranges. It is used in both SQL Server and the SSIS Integration Runtime in Azure Data Factory.
Access Modes
There are four data access modes available for extracting data from Excel:
- Table or View: Retrieve data from a worksheet or named range.
- Table Name or View Name Variable: Specify the worksheet/range through a variable.
- SQL Command: Use a SQL query to extract data, including parameterized queries.
- SQL Command from Variable: Specify the SQL query via a variable.
Connection Management
- The connection is established using an Excel Connection Manager, which specifies the workbook file.
- The Excel source has one regular output and one error output.
Excel Source Configuration
- Properties can be set via SSIS Designer or programmatically through the Advanced Editor.
- Key functionalities include creating connections, configuring data access modes, and previewing data.
Data Access Mode Options
- Table or View: Select available worksheets or named ranges.
- Variable Options: Use variables to denote worksheet names or SQL command texts.
- SQL Command Options: Build queries visually or load them from files, with syntax verification available.
Excel Source Editor
- Columns Page: Map output columns to source columns, allowing customization of column names for SSIS Designer.
- Error Output Page: Manage error handling options, such as ignoring errors, redirecting rows, or failing the component.
Error Handling
You can specify how to handle errors and truncations, enabling options to ignore failures, redirect rows, or fail the component altogether.
Related Resources
- Further details can be found in topics related to loading data from/to Excel, error handling, and configuring connections in SSIS.
This summarization enables a clear understanding of how the Excel Source functions within SSIS, its configurations, and handling mechanisms.