我有三个问题:
select count(*) from facttable;
Select distinct customerkey from facttable;
select distinct productkey from facttable;我需要使用SSIS将这三个查询的结果放在csv文件中的同一张表中,
产出如下:
行数:100(仅举例)客户of列表:12 of
15 List产品id : mokd125列表
oki89
如何将结果放在相同的csv表中?
发布于 2018-03-13 16:45:29
将提取查询更改为:
select 'Number of records: ' + cast(count(*) as varchar(50)) as data from facttable
union all select ''
union all select 'List of Customer ID:'
union all
Select distinct cast(customerkey as varchar(50)) from facttable;
union all select ''
union all select 'List of Product ID:'
union all
select distinct cast(productkey as varchar(50)) from facttable;这将为您提供可以写入文本文件的一列数据集。
UNION ALL在这里非常重要,因为它需要所有的记录。工会会处理掉副本。
https://stackoverflow.com/questions/49261125
复制相似问题