如何在 SSIS 中添加进度计数器 [英] How to add progress counter in SSIS

查看:23
本文介绍了如何在 SSIS 中添加进度计数器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在运行一个包,它从单个平面文件中提取数据并将其加载到 SQL Server 目标中.平面文件有 10,000 多行(每天更改)

I am running a package which is extracting data from a single flat file and load it into the SQL Server destination. Flat file has more than 10,000 rows (it changes daily)

有什么办法可以找到任务完成的百分比吗?就像开发人员/支持团队在像

Is there any way I can find how much percent the task is completed? Like when developer/Support team execute a select statement on a table at an instance like

Select percentComplete from PackagePerformance Where packageId = 12

他们得到如下输出:

60%

这意味着 60% 的数据在此实例中加载到 SQL 表中.

which means 60% of data is loaded into SQL table at this instance.

有什么建议吗?

推荐答案

因此您实际上无法告诉任何人该包的完成程度,因为 SSIS 不知道文件中有多少条记录.它只有在完全读入后才知道.

So you actually can't tell anyone how close the package is to completion since SSIS doesn't know how many records are in the file. It only knows that once it's completely read in.

这是我在想的一些事情

1) 如果您想写出进度指示器,请在数据流中使用脚本转换.您需要编写数据库连接器等的脚本.Google 将成为您的朋友.您可以每 1000 条记录写出一个指标.

1) if you want to write out progress indicators, then use a script transform in your dataflow. You 'll need to script out the database connectors, etc. Google will be your friend there. You could write out an indicator every 1000 records.

1) 如果你真的想要一个完整的百分比,那么完整地读取一次文件.(只需将其读入脚本任务)它真的很快,并且会给你一个记录计数.

1) If you really want a percentage complete then read the file in completely once. (just read it into a script task) It's really fast and will give you a record count.

2) 查看您使用的导入表.10,000 行确实不多.我在不到 60 秒的时间内导入了超过 1,000,000 个的文件.不过,我也没有在数据流中使用一堆转换.这可能是您的问题之一.

2) Look at the import table you are using. 10,000 rows really isn't that many. I'm importing files that have well over 1,000,000 in less than 60 seconds. I'm also not using a bunch of transforms in the dataflow though. That might be one of your issues.

这篇关于如何在 SSIS 中添加进度计数器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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