检查数据是否在excel中 [英] check if data is in excel

查看:136
本文介绍了检查数据是否在excel中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在excel中有工作表 LoadInfo ,其中包含工作表中加载的数据:


工作表日期


sheet1 201905


sheet2 201905


sheet3 201905



我想检查所有工作表是否在load_info工作表中有正确的日期(201905),如果是,请加载它。


当然,我可以加载  LoadInfo 进入db并制作简单的sql,但有没有办法使用执行sql任务并在SSIS中加载excel数据,范围 

 SELECT sheet,loaddate $来自[loadinfo $ A1:B:10]的b $ b 

并在SSIS中检查这些数据并使用约束选项做出决定?


谢谢。




解决方案

嗨  ALdo1982, 


但是有没有办法使用execute sql task和load excel SSIS中的数据范围 


是的,您可以在执行SQL任务中使用Excel连接管理器。 


使用执行SQL任务将数据加载到Object变量(vResultSet)中,并使用Foreach循环逐行迭代vResultSet中的数据。 


请参阅:


Worki带有"执行SQL任务"的"Foreach循环容器"



In excel there is sheet LoadInfo with info what data are loaded in the sheets :

sheet date

sheet1 201905

sheet2 201905

sheet3 201905

I would like to check if all the sheets has correct date (201905) in load_info sheet and if yes, load it.

Sure, I can load LoadInfo  into db and make simple sql, but is there a way to use execute sql task and load excel data in SSIS with range 

SELECT sheet, loaddate
from [loadinfo$A1:B:10]

and check this data in SSIS and make decision with constrain option?

Thanks.


解决方案

Hi ALdo1982, 

but is there a way to use execute sql task and load excel data in SSIS with range 

Yes, you can use Excel Connection Manager in Execute SQL Task. 

Use Execute SQL Task to load the data into an Object variable(vResultSet), and use Foreach Loop to iterate the data from vResultSet row by row. 

Please see:

Working with "Foreach Loop container" with "Execute SQL Task"


这篇关于检查数据是否在excel中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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