I need a DOS command or a batch (.bat) file I can execute to run all the *.sql scripts in a directory and its subdirectories. What would the solution be?
Sql – DOS command to execute all SQL script in a directory and subdirectories
batch-filedossqltsql
Related Topic
- Sql – How to list the tables in a SQLite database file that was opened with ATTACH
- Windows batch files: .bat vs .cmd
- Windows – In Windows cmd, how to prompt for user input and use the result in another command
- The current directory in a batch file
- Sql – Find all tables containing column with specified name – MS SQL Server
- How to “comment-out” (add comment) in a batch/cmd
- Mysql – How to import an SQL file using the command line in MySQL
Best Answer
The following will get you started
Run from the command line that will print the names of all the SQL files in the current directory and all sub directories.
Then substitute
sqlcmd <connection args> -i%f
forecho %f
to execute the scripts.Hope this helps.