Available Destination Column not updating new column
i have package pulling 3 separate databases of today working fine. however, have request add calculation in query of whether or not commercial account or not. added in using case statement , on functioning in management studio. however, when pull code ssis package not able select 'commercial' in available destination columns. have confirmed in destination table , appears in available input. i've refreshed , tried adding manually advanced editor no success. read on thread union might issue wasn't before don't think problem. reason isn't reading case statement destination column. ideas appreciated. code below.
declare @end as datetime declare @yesterday as datetime declare @window as datetime set @end = datediff(dd,0,getdate()) set @yesterday = dateadd(dd,-1,@end) set @window = dateadd(dd,-5,@end) print @end print @yesterday print @window select 'in' as source, cast(cast(lastmoddate as varchar)as datetime) as importdate, proform_in.dbo.usertable01.firmfile, loannumb, byr1nam1, byr1nam2, proform_in.dbo.usertable01.orddate, loanamt, loanamt_2, loanamt_3, loanofcr, loanofcr_2, loanofcr_3, invtot, invtot_2, invtot_3, byr1adr1, byr1adr2, (select cast(cast(settdate as varchar(20))as datetime) from proform_in.dbo.usertable01 as u where u.settdate > 0 and u.firmfile = proform_in.dbo.usertable01.firmfile) as settdate, (select cast(cast(disdate as varchar(20))as datetime) from proform_in.dbo.usertable01 as u where u.disdate > 0 and u.firmfile = proform_in.dbo.usertable01.firmfile) as disdate, --co, mic, inc, pac, wvc or flc 1,573 case when proform_in.dbo.usertable01.firmfile like '%co' then 1 when proform_in.dbo.usertable01.firmfile like '%mic' then 1 when proform_in.dbo.usertable01.firmfile like '%inc' then 1 when proform_in.dbo.usertable01.firmfile like '%pac' then 1 when proform_in.dbo.usertable01.firmfile like '%wvc' then 1 when proform_in.dbo.usertable01.firmfile like '%flc' then 1 else 0 end as commercial from proform_in.dbo.usertable01 left outer join proform_in.dbo.lastmodification on proform_in.dbo.usertable01.firmfile = proform_in.dbo.lastmodification.firmfile left outer join proform_in.dbo.search on proform_in.dbo.usertable01.firmfile = proform_in.dbo.search.firmfile where cast(cast(lastmoddate as varchar)as datetime) between @window and @end union all select 'oh' as source, cast(cast(lastmoddate as varchar)as datetime) as importdate, proform_oh.dbo.usertable01.firmfile, loannumb, byr1nam1, byr1nam2, proform_oh.dbo.usertable01.orddate, loanamt, loanamt_2, loanamt_3, loanofcr, loanofcr_2, loanofcr_3, invtot, invtot_2, invtot_3, byr1adr1, byr1adr2, (select cast(cast(settdate as varchar(20))as datetime) from proform_oh.dbo.usertable01 as u where u.settdate > 0 and u.firmfile = proform_oh.dbo.usertable01.firmfile) as settdate, (select cast(cast(disdate as varchar(20))as datetime) from proform_oh.dbo.usertable01 as u where u.disdate > 0 and u.firmfile = proform_oh.dbo.usertable01.firmfile) as disdate, case when proform_oh.dbo.usertable01.firmfile like '%co' then 1 when proform_oh.dbo.usertable01.firmfile like '%mic' then 1 when proform_oh.dbo.usertable01.firmfile like '%inc' then 1 when proform_oh.dbo.usertable01.firmfile like '%pac' then 1 when proform_oh.dbo.usertable01.firmfile like '%wvc' then 1 when proform_oh.dbo.usertable01.firmfile like '%flc' then 1 else 0 end as commercial from proform_oh.dbo.usertable01 left outer join proform_oh.dbo.lastmodification on proform_oh.dbo.usertable01.firmfile = proform_oh.dbo.lastmodification.firmfile left outer join proform_oh.dbo.search on proform_oh.dbo.usertable01.firmfile = proform_oh.dbo.search.firmfile where cast(cast(lastmoddate as varchar)as datetime) between @window and @end union all select 'mi' as source, cast(cast(lastmoddate as varchar)as datetime) as importdate, proform_mi.dbo.usertable01.firmfile, loannumb, byr1nam1, byr1nam2, proform_mi.dbo.usertable01.orddate, loanamt, loanamt_2, loanamt_3, loanofcr, loanofcr_2, loanofcr_3, invtot, invtot_2, invtot_3, byr1adr1, byr1adr2, (select cast(cast(settdate as varchar(20))as datetime) from proform_mi.dbo.usertable01 as u where u.settdate > 0 and u.firmfile = proform_mi.dbo.usertable01.firmfile) as settdate, (select cast(cast(disdate as varchar(20))as datetime) from proform_mi.dbo.usertable01 as u where u.disdate > 0 and u.firmfile = proform_mi.dbo.usertable01.firmfile) as disdate, case when proform_mi.dbo.usertable01.firmfile like '%co' then 1 when proform_mi.dbo.usertable01.firmfile like '%mic' then 1 when proform_mi.dbo.usertable01.firmfile like '%inc' then 1 when proform_mi.dbo.usertable01.firmfile like '%pac' then 1 when proform_mi.dbo.usertable01.firmfile like '%wvc' then 1 when proform_mi.dbo.usertable01.firmfile like '%flc' then 1 else 0 end as commercial from proform_mi.dbo.usertable01 left outer join proform_mi.dbo.lastmodification on proform_mi.dbo.usertable01.firmfile = proform_mi.dbo.lastmodification.firmfile left outer join proform_mi.dbo.search on proform_mi.dbo.usertable01.firmfile = proform_mi.dbo.search.firmfile where cast(cast(lastmoddate as varchar)as datetime) between @window and @end
decided update column after fact using following:
update filenet set commercial = 1 firmfile '%co'; update filenet set commercial = 1 firmfile '%mic'; update filenet set commercial = 1 firmfile '%inc'; update filenet set commercial = 1 firmfile '%pac'; update filenet set commercial = 1 firmfile '%wvc'; update filenet set commercial = 1 firmfile '%flc'; update filenet set commercial = 0 commercial null
SQL Server > SQL Server Integration Services
Comments
Post a Comment