PDA

View Full Version : Windows: Sourcing SQL Files


Stabones
10-02-2013, 08:12 PM
So, there are a lot of files to source...

source a.sql
source b.sql

...


source zz.sql

No thanks.

For future sourcing, use:

copy /b *.sql all_files.sql

This will take all .sql files in the directory and concatenate them into one. Want to pick and choose what to source? Select all .sql files you are interested in, copy them to a temp folder, and then run the copy command above!

Stabones

sorvani
10-02-2013, 08:25 PM
There are like two things to source.

Stabones
10-02-2013, 08:31 PM
Not when you do proper source control

lerxst2112
10-02-2013, 08:42 PM
for %i in (*.sql) do mysql -uroot -ppassword peq < %i

Stabones
10-02-2013, 10:18 PM
for %i in (*.sql) do mysql -uroot -ppassword peq < %i

Always good to see other solutions.

Cheers!