简单批处理执行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
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
相关文章推荐
- 一个ASP(JScript)简单SQL语句构建“类”,同时支持客户端和服务器端执行的
- 将一条T-SQL语句执行N次最简单的方法
- bat批处理文件执行Oracle sql语句
- log4j.xml 简单配置 打印 mybatis 执行的 sql 语句
- 批处理执行SQL语句
- SQL2008、SQL2013 执行Transact-SQL 语句或者批处理时发生了异常。错误5120
- 一个ASP(JScript)简单SQL语句构建“类”,同时支持客户端和服务器端执行的
- 利用SQL语句创建、修改、执行、删除存储过程(简单应用)
- 批处理文件.bat执行sql升级语句
- C#使用参数化和块语句来提高批处理SQL语句的执行效率
- bat批处理文件执行Oracle sql语句
- oracle利用批处理文件执行SQL语句,bat连接oracle数据库并执行语句
- 使用参数化和块语句来提高批处理SQL语句的执行效率
- 如何以批处理方式执行多条SQL语句
- 使用参数化和块语句来提高批处理SQL语句的执行效率(2)
- 批处理SQL语句的执行效率提高的方法
- [转]如何在sql2005里简单查看sql语句的执行时间和IO读写
- 一个简单的存储过程(实现事务执行两个sql语句,修改可实现执行更多条sql语句)
- 错误 执行Transact-SQL语句批处理时发生了异常。无法设置主体'sa'的凭据
- JDBC之数据库的连接与简单的sql语句执行