Importing Grouped Report Data to Database(将分组报表数据导入数据库)
问题描述
我的公司从无法以任何直接格式提供数据的客户接收数据,因此我们必须导入多份呈分组布局的报告,如下所示.我们必须开发内部方法来取消对报告的分组,然后导入数据以获取我们需要的所有数据.目前,我团队的一名成员正在使用 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
这篇关于将分组报表数据导入数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:将分组报表数据导入数据库


基础教程推荐
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- 带更新的 sqlite CTE 2022-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- 带有WHERE子句的LAG()函数 2022-01-01