TIME_CONTROL_TRANS.bat 1.4 KB

12345678
  1. @echo off
  2. rem ==TIME_CONTROL_TRANS==
  3. del C:\GlobalCube\System\OPTIMA\SQL\temp\OPTIMA\TIME_CONTROL_TRANS*.* /Q /F >nul 2>nul
  4. sqlcmd.exe -S localhost\GLOBALCUBE -d OPTIMA -U sa -P Mffu3011# -p -Q "TRUNCATE TABLE [import].[TIME_CONTROL_TRANS]"
  5. bcp "SELECT T1.[PERSON_GROUP], T1.[PERSON_NUMBER], T1.[WORK_TRANS_DATE], T1.[WORK_START_TIME], T1.[WORK_END_TIME], T1.[ORDER_NUMBER], T1.[LINE_NUMBER], T1.[REPAIR_CODE], T1.[WORK_ACT_CODE], T1.[TMCS_TRANS_TYPE], T1.[HANDLER], T1.[FUNCTION_CODE], T1.[PROGRAM], T1.[UNIQUE_IDENT], T1.[timestamp], T1.[CONV_FLAG], T1.[EXTERNAL_SYSTEM], '1' as \"Client_DB\" FROM [deop01].[dbo].[TIME_CONTROL_TRANS] T1 " queryout "C:\GlobalCube\System\OPTIMA\SQL\temp\OPTIMA\TIME_CONTROL_TRANS_1.csv" -S DADE053821 -d deop01 -U sa -P sybjdc -c -C 65001 -e "C:\GlobalCube\System\OPTIMA\SQL\temp\OPTIMA\TIME_CONTROL_TRANS_1.queryout.log" > "C:\GlobalCube\System\OPTIMA\SQL\temp\OPTIMA\TIME_CONTROL_TRANS_1.bcp1.log"
  6. type "C:\GlobalCube\System\OPTIMA\SQL\temp\OPTIMA\TIME_CONTROL_TRANS_1.bcp1.log" | findstr -v "1000"
  7. bcp [import].[TIME_CONTROL_TRANS] in "C:\GlobalCube\System\OPTIMA\SQL\temp\OPTIMA\TIME_CONTROL_TRANS_1.csv" -S localhost\GLOBALCUBE -d OPTIMA -U sa -P Mffu3011# -c -C 65001 -m 1000 -e "C:\GlobalCube\System\OPTIMA\SQL\temp\OPTIMA\TIME_CONTROL_TRANS_1.in.log" > "C:\GlobalCube\System\OPTIMA\SQL\temp\OPTIMA\TIME_CONTROL_TRANS_1.bcp2.log"
  8. type "C:\GlobalCube\System\OPTIMA\SQL\temp\OPTIMA\TIME_CONTROL_TRANS_1.bcp2.log" | findstr -v "1000"