Created
January 29, 2020 02:44
-
-
Save Unripe01/f66f6f8a3658d8143331693884a33c0f to your computer and use it in GitHub Desktop.
SQLファイルをドラッグ&ドロップして連続実行するバッチ
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal | |
set server=DBSERVER_123 | |
set user=myName | |
set password=******* | |
set databasename=DATABASE_123 | |
pushd "%~dp0" | |
for %%f in (%*) do ( | |
echo 開始-----%%f | |
echo "%%~nf%%~xf" | |
sqlcmd -S %server% -U %user% -P %password% -d %databasename% -i %%f | |
echo 終了-----%%f | |
echo . | |
pause | |
echo . | |
) | |
popd | |
echo すべてのファイル実行完了 | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment