DM、DW、ODS三个文件夹中存放的是SQL脚本
Bat文件用于执行文件夹中的SQL脚本
@echo off
SET sqlpath=%~dp0
set cur_dir_ODS=%sqlpath%ODS\*.sql
set cur_dir_DW=%sqlpath%DW\*.sql
set cur_dir_DM=%sqlpath%DM\*.sql
set /a ODS_count=0
set /a DW_count=0
set /a DM_count=0
echo -e"\n"
echo -e"\n"
for %%i in (%cur_dir_ODS%) do (
SQLCMD -S CNSD2SAPCALM001\DW -d GMAC_ODS -E -i %%i
set /a ODS_count+=1
)
echo "file count is " %ODS_count%
for %%i in (%cur_dir_DW%) do (
SQLCMD -S CNSD2SAPCALM001\DW -d GMAC_DW -E -i %%i
set /a DW_count+=1
)
echo "file count is " %DW_count%
R
for %%i in (%cur_dir_DM%) do (
SQLCMD -S CNSD2SAPCALM001 -d GMAC_DM_PEGA -E -i %%i
set /a DM_count+=1
)
echo "file count is " %DM_count%