一連の csv ファイルから行を読み取り、データベース内の既存のテーブルに書き込む必要があります。ただし、これを行うには、フラット ファイル データを、データベース内のテーブルから選択した 2 つの値と組み合わせる必要があります。Lookup 変換を使用して、これを可能にする SSIS の設計を構築しました。ただし、機能していません:(
これが私のデザインです:
デバッグすると、次のメッセージが表示されます。
Error at Contacts [SSIS.Pipeline]: input column "ObjectId" (914) has lineage ID 709 that was not previously used in the Data Flow task.
Error at Contacts [SSIS.Pipeline]: "component "OLE DB Destination" (134)" failed validation and returned validation status "VS_NEEDSNEWMETADATA".
Error at Contacts [SSIS.Pipeline]: One or more component failed validation.
Error at Contacts: There were errors during task validation.
(Microsoft.DataTransformationServices.VsIntegration)
ObjectId は、ルックアップ内で選択している int です。ルックアップのクエリ全体は次のとおりです。
DECLARE @ObjectId int
Select @ObjectId = (SELECT TOP (1) [Value] as ObjectId
FROM dbo.Sequences WHERE (Name = 'Contact'));
UPDATE Sequences SET Value = Value + 1 WHERE (Name = 'Contact');
SELECT ObjectId = @ObjectId, Reference = N'CU' + cast(@ObjectId as VARCHAR(20))
このクエリはプレビューで完全に機能します。誰かが私が間違っていることを教えてもらえますか? 無知で申し訳ありませんが、これは私が SSIS で行った最初のことです。
更新 1 (@billinkc の回答を参照)
新しいデザイン:
新しいエラー:(
Error at Contacts [Lookup Sequence [531]]: SSIS Error Code DTS_E_OLEDBERROR. An OLE DB error has occurred. Error code: 0x80004005.
An OLE DB record is available. Source: "Microsoft SQL Server Native Client 10.0" Hresult: 0x80004005 Description: "Syntax error, permission violation, or other nonspecific error".
Error at Contacts [Lookup Sequence [531]]: OLE DB error occurred while loading column metadata. Check SQLCommand and SqlCommandParam properties.
Error at Contacts [SSIS.Pipeline]: "component "Lookup Sequence" (531)" failed validation and returned validation status "VS_ISBROKEN".
Error at Contacts [SSIS.Pipeline]: One or more component failed validation.
Error at Contacts: There were errors during task validation.
(Microsoft.DataTransformationServices.VsIntegration)