Return to Snippet

Revision: 9604
at November 13, 2008 14:20 by hoffstein


Initial Code
for %f in ("c:\path\to\dir\*.sql") do sqlcmd -S [SERVER_NAME] -d [DATABASE_NAME] -i "%f" -b

Initial URL

                                

Initial Description
This assumes that you have sqlcmd (comes with SQL Server client tools) installed and wish to execute every file ending in .sql within the given directory against the specified server and database using Windows Authentication.

Initial Title
DOS command to run all SQL scripts in a path

Initial Tags
sql

Initial Language
DOS Batch