Quantcast
Channel: SQL Server Integration Services forum
Viewing all articles
Browse latest Browse all 24688

Multiple aggregates from OLEDBSource into OLE DB Destination

$
0
0

Please advice if the following is possible using SSIS

Please run the following code in SSMS

Drop table #test Create table #test (CustomerNumber varchar(10),CustomerType varchar(10),Source Varchar(10)) insert into #test values('C1','Old','TV') insert into #test values('C2','OLD','TV') insert into #test values('C3','New','Internet') Drop table #test2 Create table #test2 (customernumber varchar(10),CustomerFirstName varchar(10),CustomerLastName varchar(10)) insert into #test2 values('C1','Jon','Ste') insert into #test2 values('C2','Doe','Dove') insert into #test2 values('C3','Lov','Daisy') Select a.CustomerNumber, a.CustomerType, a.Source, b.CustomerFirstName, b.CustomerLastName, COUNT(Distinct(Case when a.CustomerType='Old' and b.customerfirstname='Jon' then a.CustomerNumber else null end )) as OldCustomers, COUNT(Distinct(Case when a.CustomerType='New' and b.customerfirstname='Lov' and a.Source='Internet' then a.CustomerNumber else null end )) as NewCustomers

into #results from #test a inner join #test2 b on a.customernumber=b.customernumber group by a.CustomerNumber, a.CustomerType, a.Source, b.CustomerFirstName, b.customerlastname

The reason I want to do the same aggregation in SSIS as the tsql code is taking more than 2 hours and I am looking for options to make it run faster.

I am doing 19 different aggregations in the tsql statement and the number of rows is more thna 19 million.

Please explain what kind of dataflowtask can I use to perform the calculation.

Thanks for your input


gs





Viewing all articles
Browse latest Browse all 24688

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>