sql server - Is it possible to create a Fact table with multiple sql scripts in SSIS? -
let's have 4 different scripts, , of columns used create fact table, if paste these 4 scripts in sql command in ole db source, work? taking consideration created table composed of columns in 4 sql scripts used. if it's possible... can put 4 different scripts inside sql command in ole db source?? cause confusion in mapping section if create of columns (in 4 scripts) in table put in ole db destination?
sql 1:
select r.resourceid, r.subsubfunctioncode, r.sublocationcode, r.site, sitedesc, t.resourceid, sum(itemvalue1) hoursoutstanding, sum(itemvalue1 * isnull(case when itemvalue2 = 0 costrateregoper else costrateintoper end,0)) opercostoutstanding, sum(itemvalue1 * isnull(case when itemvalue2 = 0 chargerateregoper else chargerateintoper end,0)) operrevenueoutstanding, sum(itemvalue1 * isnull(case when itemvalue2 = 0 costratereghome else costrateinthome end,0)) homecostoutstanding, sum(itemvalue1 * isnull(case when itemvalue2 = 0 chargeratereghome else chargerateinthome end,0)) homerevenueoutstanding, homecurrcode, sum(itemvalue1 * isnull(case when itemvalue2 = 0 costrateregnat else costrateintnat end,0)) natcostoutstanding, sum(itemvalue1 * isnull(case when itemvalue2 = 0 chargerateregnat else chargerateintnat end,0)) natrevenueoutstanding, natcurrcode ods_staff_task t, ods_currentresource r t.tasktypeid in (5,6) --missing time , r.resourceid = t.resourceid , r.resourcetypecode <> 'c' , t.sitedesc = r.resourcesite
sql 2:
select sitedesc, t.resourceid, sum(itemvalue1) expensetoapprove ods_staff_task t t.tasktypeid in (2) group sitedesc, t.resourceid
sql 3:
select sitedesc, t.resourceid, sum(itemvalue1) holdstorelease ods_staff_task t t.tasktypeid in (3) group sitedesc, t.resourceid
sql 4:
select sitedesc, t.resourceid, sum(itemvalue1) monthlyreviewsoutstanding ods_staff_task t t.tasktypeid in (4) group sitedesc, t.resourceid
many thanks!
beau
i'd try have 1 ole db source each select statement , use union block to, union rows. , can map columns in union block destination. end lot of nulls though. since not columns exists in of queries.
Comments
Post a Comment