using sqlcompare command line to generate scripts for backup

Compares and synchronizes SQL Server databases, backups and scripts.

Moderators: JonathanWatts, Chris Auckland, David Atkinson, eddie davis, Anu Deshpande, Michelle Taylor, alice.easey, james.billings, chengvoon.tong

using sqlcompare command line to generate scripts for backup

Postby dma550 » Thu Jan 24, 2013 7:57 pm

Hey guys

I have some large databases I develop regularly. I dont want to backup (via Mozy) the database itself, but all the DDL has importance to me. I cannot use a source control provider at this time.

I want to schedule a script dump daily and have Mozy pick it up. However, it would be nice that if the DB objects dont change that Mozy doesn't have to process them. I tried this

Code: Select all
sqlcompare  /Database1:MyDBName /Makescripts:"c:\\sqldata\\scripts\\mydbname"


but got

Code: Select all
Error: The folder 'c:\\sqldata\\scripts\\myDB' exists. SQL Compare cannot
dump scripts from a database into a folder that already contains data. Use the
/synchronize option if you want to merge scripts into an existing folder.


If I am to pull this off right, do I need to do this to a temp area and /sync it to another file? Can anyone supply an example?
dma550
 
Posts: 6
Joined: Mon Sep 26, 2005 4:07 pm

Postby dma550 » Sun Jan 27, 2013 2:24 pm

I did figure this out - I created a work folder, do a script to it. Then, I do a /sync /force between the folders, and only the changed files are touched. Then, these are picked up by Mozy as deltas.
dma550
 
Posts: 6
Joined: Mon Sep 26, 2005 4:07 pm

Postby Anu Deshpande » Mon Jan 28, 2013 10:36 am

Many thanks for your post and solution.

I am glad that this worked for you.

Kindly let us know if you have any other issues or questions regarding SQL Compare,I'll like to help.
Anuradha Deshpande
Product Support
Redgate Software Ltd.
E-mail: support@red-gate.com
Anu Deshpande
 
Posts: 692
Joined: Mon Apr 20, 2009 3:53 pm
Location: Cambridge


Return to SQL Compare 10

Who is online

Users browsing this forum: No registered users and 0 guests