Skip to content

Instantly share code, notes, and snippets.

@Unripe01
Created January 29, 2020 02:44
Show Gist options
  • Save Unripe01/f66f6f8a3658d8143331693884a33c0f to your computer and use it in GitHub Desktop.
Save Unripe01/f66f6f8a3658d8143331693884a33c0f to your computer and use it in GitHub Desktop.
SQLファイルをドラッグ&ドロップして連続実行するバッチ
@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