LoginSignup
0
0

More than 5 years have passed since last update.

sqlcmdで任意のフォルダ配下のクエリを実行

Posted at

@echo off

REM DIR_NAME配下のSQL文実行

REM -------初期値設定-----
set SERVER_NAME=hoge\SQLEXPRESS
set DB_NAME=fuga
set USER_NAME=poyo
set PASS_WORD=peyo
set DIR_NAME=D:\HOME\DB\SRC
REM ----------------------


for /R %DIR_NAME% %%a in (*) do (

sqlcmd  -e -S %SERVER_NAME% -d %DB_NAME% -P %PASS_WORD% -U %USER_NAME% -i %%a

)

pause
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0