Skip to content

Instantly share code, notes, and snippets.

@FeniXb3
Created March 6, 2014 17:42
Show Gist options
  • Save FeniXb3/9395290 to your computer and use it in GitHub Desktop.
Save FeniXb3/9395290 to your computer and use it in GitHub Desktop.
Small Windows batch script to execute all SQL scripts in current directory. The database name is passed as a parameter.
for %%G in (*.sql) do sqlcmd /S [servername] /d %1 -U [SQL username] -P [password] -i"%%G"
pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment