0

DimInternationalFunction というテーブルを作成しました。

IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[DimInternationalFunction]') AND type in (N'U'))
DROP TABLE [DimInternationalFunction]
Go
Create Table DimInternationalFunction
(IntFunctionKey int NOT NULL identity primary key,
SubSubFunctionString char(10),
FunctionCode char(3),
SubFunctionCode char(6),
SubSubFunctionCode char(10),
SubSubFunctionName nvarchar(60),
SubFunctionName nvarchar(60), 
FunctionName nvarchar(60))

最初に、SSMS のこのテーブルにレコードを挿入しました。


SSMS で最初のレコードを手動で挿入した後、マネージャーは SSIS を使用して「新しいレコードのみ」を挿入するように求めています。

これをSSMSで使用してみましたが、うまくいきました。レコードが 0 件挿入されるか、結果として 5 件のレコードが挿入されることがあります。私のマネージャーは、SSIS でこれを行うように求めています。

データ アクセス モードの OLE DB ソース内でこのスクリプトを使用してみました: SQL コマンドと SQL コマンド テキスト:

insert into DWResourceTask.dbo.DimInternationalFunction
select f.SubSubFunctionString,
f.FunctionCode,
f.SubFunctionCode,
f.SubSubFunctionCode,
f.SubSubFunctionName,
f.SubFunctionName, 
f.FunctionName
 from ODS_Function F
where FunctionViewCode = 'INT'
and not exists (select * from DWResourceTask.dbo.DimInternationalFunction I
                where (f.SubSubFunctionString=i.SubSubFunctionString
                        and f.FunctionCode=i.FunctionCode
                        and f.SubFunctionCode=i.SubFunctionCode
                        and f.SubSubFunctionCode=i.SubSubFunctionCode
                        and f.SubSubFunctionName=i.SubSubFunctionName
                        and f.SubFunctionName=i.SubFunctionName
                        and f.FunctionName=i.FunctionName)
)

プレビューをクリックした後に表示されるエラー メッセージは次のとおりです。

The component reported the following warnings:

Error at Int Function [International Function Table [33]]: No column information was returned by the SQL command.


Choose OK if you want to continue with the operation.
Choose Cancel if you want to stop the operation.

これを実行できる SSIS の別のコンポーネントはありますか? または、exec sql タスク コンポーネントまたは ole db ソースのいずれかを使用できますか?

データ フロー タスクに接続された exec sql タスクを使用することを考えています。データ フロー タスク内で、ステージング テーブルを含む ole db ソースを配置し、それを削除するか、それを行う他の方法があります。助けてください。前もって感謝します。

4

1 に答える 1

0

SQL 実行タスクを使用して実行できます。

「純粋な SSIS の方法」で実行したい場合は、ルックアップ コンポーネントを使用できます。「一致しない行」ハンドラーを「一致しない出力にリダイレクトする」に設定し、ターゲット テーブルを接続とし​​て構成します。次に、「一致出力」を無視して、「一致しない出力」のみを使用します。そして、「一致しない出力」からターゲットにレコードを送信します。

「ルックアップ」コンポーネントは、その名前にもかかわらず、多くの場合、データのフィルタリングに使用できます。

しかし、SQL 実行タスクは、データベース エンジン内にすべてのデータを保持する大規模なデータ セットに対してより効率的であると思います。

于 2013-11-08T09:22:14.063 に答える