您的位置:首页 > 数据库

简单批处理执行SQL语句

2016-09-05 20:30 417 查看
@ECHO OFF

cls

echo *******************************************************

echo BactFile 実行環境選択

echo *******************************************************

echo [1]:TESTMPSDMI

echo [2]:TESTMPSPA

echo *******************************************************

set /p ENT="DataBase を 選択してください。>"

setlocal

if "%ENT%"=="1" (
set dbnm=TESTMPSDMI

) else (
set dbnm=TESTMPSPA

)

echo DataBase : %dbnm%

echo .

echo 途中で終了したい場合は、「Ctrl + C」を入力してください。

PAUSE

osql -S localhost -U sa -P MPS@Admin -d %dbnm% -i .\SC120.sql > SC120_Insert.log

osql -S localhost -U sa -P MPS@Admin -d %dbnm% -i .\SC200.sql > SC200_Insert.log

osql -S localhost -U sa -P MPS@Admin -d %dbnm% -i .\SC210.sql > SC210_Insert.log

osql -S localhost -U sa -P MPS@Admin -d %dbnm% -i .\SC220.sql > SC220_Insert.log

osql -S localhost -U sa -P MPS@Admin -d %dbnm% -i .\SC230.sql > SC230_Insert.log

osql -S localhost -U sa -P MPS@Admin -d %dbnm% -i .\SC240.sql > SC240_Insert.log

osql -S localhost -U sa -P MPS@Admin -d %dbnm% -i .\SC250.sql > SC250_Insert.log

osql -S localhost -U sa -P MPS@Admin -d %dbnm% -i .\SC260.sql > SC260_Insert.log

osql -S localhost -U sa -P MPS@Admin -d %dbnm% -i .\SC300.sql > SC300_Insert.log

osql -S localhost -U sa -P MPS@Admin -d %dbnm% -i .\SC310.sql > SC310_Insert.log

osql -S localhost -U sa -P MPS@Admin -d %dbnm% -i .\SC320.sql > SC320_Insert.log

osql -S localhost -U sa -P MPS@Admin -d %dbnm% -i .\SI030.sql > SI030_Insert.log

osql -S localhost -U sa -P MPS@Admin -d %dbnm% -i .\SI040.sql > SI040_Insert.log

osql -S localhost -U sa -P MPS@Admin -d %dbnm% -i .\update_sql.sql > update_sql_Update.log
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: