Page 1 of 1

Excluding tables from difference script (command line)

Posted: Thu 28 Apr 2011 06:11
by ivan
Hello, I have a question regarding schema compare for MS SQL Server.
Is it possible to exclude some tables from comparison process or from generated synchronization script while doing it through command line?

Thanks

Posted: Thu 28 Apr 2011 08:21
by .jp
Thanks for the post.
Yes, you can. First of all create a new comparison and exclude objects. Then save the comparison document to the disk. Then you can start dbForge Schema Comparer from command line using "/compfile " option to specify the tuned comparison.

Posted: Thu 28 Apr 2011 08:47
by ivan
Aha. I see. And should I recreate this .comp file every time I have my schema changed (in case then excluded tables stay the same but some new table appears)?

Posted: Thu 28 Apr 2011 09:47
by ivan
I just found that scom is an xml file and it contains only excluded table. This answers on my second question.

Thanks for help. Schema compare is really great.

Posted: Thu 28 Apr 2011 10:17
by .jp
We plan to add the "Include objects by mask" and "Exclude objects by mask" options in the next version. With the help of these options you will be able to specify the objects that should be excluded from comparison (mapping) and the objects that should be forcibly included into comparison using regular expressions. That means you will be able to do this visually and without hacking XML file.

Posted: Thu 28 Apr 2011 10:45
by ivan
Cool. It would be very useful.

Posted: Mon 02 May 2011 10:43
by ivan
By the way Does anybody know why schemacompare.com cant be run with ant task or directly with java spawn command?

Posted: Tue 10 May 2011 10:36
by .jp
ivan wrote:By the way Does anybody know why schemacompare.com cant be run with ant task or directly with java spawn command?
To run Schema Compare via command line in Scheduled Task, you should specify complete paths to the files. If there are spaces in names, you should write them in quotes.
To make working with command line more comfortable, you can create a *.bat file with the run command, and then open this file to run the program via command line. For example, you can insert the following line to the run.bat file:

Code: Select all

"D:\Program Files\Devart\dbForge Schema Compare for SQL Server\schemacompare.com" /schemacompare /compfile:"D:\Program Files\Devart\dbForge Schema Compare for SQL Server\sc.scomp" /report:"D:\Program Files\Devart\dbForge Schema Compare for SQL Server\schemacompare.html"

Posted: Tue 10 May 2011 16:59
by ivan
Yes. I created a bat file. It runs directly without any problems but it cant be run from ant. It doesnt show any error messages just skips a command.