
BCP處理數(shù)據(jù)時(shí)顯示執(zhí)行結(jié)果并保存到文件在批處理中使用bcp命令把數(shù)據(jù)庫中的表導(dǎo)出來,代碼如下:
在執(zhí)行中會(huì)顯示每個(gè)表導(dǎo)出的狀態(tài),如下:現(xiàn)在需要在代碼執(zhí)行過程中把結(jié)果保存到txt中,同時(shí)不影響在窗口中顯示,求解救???注:我曾嘗試過每個(gè)語句執(zhí)行兩邊,第一遍在批處理窗口中顯示,第二遍執(zhí)行結(jié)果保存到文件中,但這樣執(zhí)行的時(shí)間會(huì)翻倍,但是想不出更好的辦法了 {:3_49:} {:3_49:}nclick="copycode($('code0'));">復(fù)制代碼
- bcp t_im_stock_target out C:t_im_stock_target.txt -T -c
- bcp t_pc_branch_price_breakpoint out C:t_pc_branch_price_breakpoint.txt -T -c
- bcp t_tm_balance_monthly out C:t_tm_balance_monthly.txt -T -c
- bcp t_rm_operator_log out C:t_rm_operator_log.txt -T -c
- bcp t_bd_item_cls_breakpoint out C:t_bd_item_cls_breakpoint.txt -T -c

