我试图弄清楚如何将我的 SSIS 包导出到多个 excel 文件。这些文件将具有相同的字段并从同一个表中提取数据。但是,查询语句是不同的。我试图弄清楚如何使用“for循环容器”来做到这一点。
这两个查询如下:
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