2013-01-11 3 views
1

SSIS 패키지를 여러 Excel 파일로 내보내는 방법을 알아 내려고하고 있습니다. 파일은 동일한 테이블에서 동일한 필드와 데이터를 가져옵니다. 그러나 쿼리 문은 다릅니다. "for 루프 컨테이너"를 사용하여이 작업을 수행하는 방법을 파악하려고합니다. 당신은 단지 두 개의 별도의 수출이 필요 -SSIS 다른 SQL 문을 사용하여 muliple excel 파일로 내보내기

select acct_num, item, value_year, value_status, eff_date, ref_num,ValueAmount, mileage, 
    valuation_method, note, filing_date, late_ind, billg_typ_ndx, cur_seq, supp_num, 
    exempt_type, district_code, district2, district3, form_num, cost, bill_no, 
    first_half_batch, sec_half_batch, status, dmv_type, leasing_type, bus_pct, 
    last_mod, last_user, veh_type, mileage_amt, msrp 
FROM make_pp_valuation 
where acct_num not in (select distinct acct_num from dbo.pp_accessory_values) 
ORDER by acct_num" 

select v.acct_num, v.item, v.value_year, v.value_status, v.eff_date, v.ref_num, v.ValueAmount, v.mileage, v.valuation_method, v.note, v.filing_date, v.late_ind, v.billg_typ_ndx, v.cur_seq, v.supp_num, v.exempt_type, v.district_code, v.district2, v.district3, v.form_num, v.cost, v.bill_no, v.first_half_batch, v.sec_half_batch, v.status, v.dmv_type, v.leasing_type, v.bus_pct, v.last_mod, v.last_user, v.veh_type, v.mileage_amt, v.msrp 
FROM make_pp_valuation 
    v inner join pp_accessory_values a on v.acct_num = a.acct_num and v.item = a.item 
ORDER by v.acct_num 

답변

1

에 대한 루프 컨테이너가 여기에 필요하지 않습니다 다음과 같이

두 쿼리

입니다. 두 개의 데이터 흐름 작업을 제어 흐름에 추가하고 각각이 필요한 파일을 내보낼 수있게하십시오.

관련 문제