SSIS 从记录集读取而不是从数据库读取 [英] SSIS reading from Record set instead of Database

查看:25
本文介绍了SSIS 从记录集读取而不是从数据库读取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在做一些大量数据的数据迁移,其中我需要执行一些数据匹配,以便确定需要对记录进行的操作.为此,我目前正在做的是从源读取数据,然后使用 SQL 命令匹配记录 - 因此我需要为每条记录访问数据库两次.那么,如果我将数据读取到记录集然后匹配其中的值,它会提高性能吗?

I'm doing some data migration of a large amount of data in which I need to perform some data matching in order to identify the operation that needs to be done on the record. For that What I'm currently doing is to read the data from the source and then match the records using a SQL Command - so that I need to hit the Database twice for each record. So Will it improve the performance if I read the data to a recordset and then match the values inside that ?

我正在阅读 SQL Server 2008 R2

I'm reading from SQL Server 2008 R2

推荐答案

1) 使用查找转换是合并记录的一种有效方式

1) using Look up transformation is one efficient way of merging records

例如:

2) 使用合并程序

例如:

MERGE [dbo].[Value] AS TARGET
         USING [dbo].[view_Value] AS SOURCE 
        ON ( 
            TARGET.[Col1] = SOURCE.[col1]  

            )

     WHEN MATCHED 
     THEN
     UPDATE SET
     TARGET.[col3] = SOURCE.[col3]
     TARGET.[col2] = SOURCE.[col2] 

    WHEN NOT MATCHED BY TARGET THEN 
    INSERT ([col1], [col2], [col3]  )
    VALUES (SOURCE.[col1], SOURCE.[col2], SOURCE.[col3]  )

这篇关于SSIS 从记录集读取而不是从数据库读取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆