将分组报告数据导入数据库 [英] Importing Grouped Report Data to Database

查看:127
本文介绍了将分组报告数据导入数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的公司从无法以任何直接格式提供数据的客户端接收数据,因此我们必须导入多个报告,这些报告采用分组布局,如下所示。我们必须开发内部方法来取消组合报告,然后导入数据以获取我们需要的所有数据。目前我的团队成员正在使用MS Access / VBA生成所需的详细记录,但我想将其移至基于服务器和自动化的流程。我们使用SQL Server 2008R2进行存储,我想使用SSIS来完成任务。有谁知道我可以生成详细记录并将数据直接导入SQL Server的方法?

My company receives data from a client that is unable to provide data in any direct format so we have to import several reports that are in a grouped layout like the one below. We have to develop in house methods to ungroup the report and then import the data to get all of the data we need. Currently a member on my team is using MS Access / VBA to generate the needed detail records but I want to move this to a server based and automated process. We are using SQL Server 2008R2 for storage and I would like to use SSIS to accomplish the task. Does anyone know of a way I can generate the detail records and import the data directly into SQL Server?

推荐答案

我是用脚本组件做的。

总数据流:

ExcelSource - >脚本组件(转换) - >条件拆分 - > SQL目的地

ExcelSource --> Script Component (Tranformation) --> Conditional Split --> SQL Destination

在脚本组件中:

检查InputColumns上的accountSummary

Check accountSummary on InputColumns

将ActivityDate添加为输出列。

Add ActivityDate as output column.

打开脚本:

在行处理之外。

添加:

public datetime dte;

行内处理:

if (DateTime.TryParse(Row.ActivitySummary.ToString()))
{dte=DateTime.Parse(Row.ActivitySummary.ToString());}
else
{Row.ActivityDate = dte;}

然后添加条件拆分以删除空活动日期

Then add a Conditional Split to remove null Activity Dates

这篇关于将分组报告数据导入数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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