Guest wrote:Hello! I'm backing up a large remote database nightly and all is working well. The daily .zip file contains a LOT of script files, and I'm wondering if anyone has created a nice little utility that will run through a folder full of these script files and get them executed in order, to do the restore? That would be a very handy utility to have included with Sql Backup and FTP .. hint, hint! hehe
Thanks!
Try to create the following .cmd file:
Code:FOR %%F IN (*.sql) DO sqlcmd -E -S .\SQLEXPRESS -i %%F -f 65001 >> output.txt
and run it from the folder where all your *.sql files are located.
After you run it you can read the results (errors if any) from output.txt in the same folder.
You can read more about sqlcmd
here