Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Other SQL Server Topics (2005)
 mixing DOS CMD and SQLCMD in one .bat file

Author  Topic 

jpotucek
Constraint Violating Yak Guru

273 Posts

Posted - 2010-09-27 : 14:20:37


I have the need to do the following:

Do a full set of backups.
ZIP the backups and move them to one server across the WAN
unzip and restore

I am trying to figure out how to best script this out so that it is seemless as possible.

This is being done for a one time migration but we will be running many iterations before the final cutover.

I wanted to run the backups in batches so that I can zip them in batches - the smaller zipped files seem to go across the WAN at a better rate than one HUGE zipped file.

Can anyone suggest a good way to do this? Can I use DOS scripting and run SQLCMD as well as regular DOS CMD line commands in the same .bat file?? I've been playing around with it and am really having a hard time figuring out the best solution.

any suggestions?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-09-27 : 16:26:00
Here you go: http://weblogs.sqlteam.com/tarad/archive/2009/02/25/How-to-refresh-a-SQL-Server-database-automatically.aspx

Yes you can do it all in one file.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -