Welcome! Log In


http://www.sqlservercentral.com/blogs/sqlandme/2013/03/25/sql-server-executing-multiple-script-files-using-sqlcmd/

@Echo Off

FOR /f %%i IN ('DIR *.Sql /B') do call :RunScript %%i

GOTO :END



:RunScript

Echo Executing %1

SQLCMD -S Server\Instance -U Account -P Password -i %1

Echo Completed %1



:END



Edited 1 time(s). Last edit at 12/09/2013 11:33PM by iznogoud.
Sorry, only registered users may post in this forum.

Click here to login