Sql Backup And FTP

Welcome Guest Search | Active Topics | Log In | Register
New Topic Post Reply
script to run restore scripts? Options · View
Guest
#1 Posted : Friday, September 11, 2009 2:01:53 PM Quote
Rank: Guest

Groups:

Joined: 8/10/2009
Posts: 253
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!
mikeshilov
#2 Posted : Sunday, September 13, 2009 3:03:01 AM Quote
Rank: Advanced Member

Groups: Administrators

Joined: 8/12/2009
Posts: 55
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
Quick Reply Show Quick Reply
New Topic Post Reply
Forum Jump  
You can post new topics in this forum.
You can reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.