Sql Backup And FTP

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

Groups:

Joined: 8/10/2009
Posts: 1,016
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
Rank: Administration

Groups: Administrators

Joined: 8/12/2009
Posts: 271
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
Guest
#3 Posted : Monday, June 17, 2013 7:57:25 AM
Rank: Guest

Groups:

Joined: 8/10/2009
Posts: 1,016
mikeshilov wrote:
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


Can you explain, what codepage should I choose? In your example it - 65001
alexs
#4 Posted : Monday, June 17, 2013 10:01:18 AM
Rank: Administration

Groups: Administrators, Registered

Joined: 7/12/2012
Posts: 194
65001 it's a UTF-8 code page.
Your code page is depends on OS locale or SQL Server installation.
More datails http://msdn.microsoft.com/en-US/library/ms177439(v=sql.90).aspx
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You can create polls in this forum.
You can vote in polls in this forum.

©Pranas.NET Sql Server Backup MySql Backup Free SQl Backup SQL Backup Master Employee monitoring software Web Scraping Azure SQL Database Backups ergonotes.com