Excluding tables from difference script (command line)

Discussion of open issues, suggestions and bugs regarding database management and development tools for SQL Server
Post Reply
ivan
Posts: 6
Joined: Thu 28 Apr 2011 06:04

Excluding tables from difference script (command line)

Post by ivan » Thu 28 Apr 2011 06:11

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

.jp
Devart Team
Posts: 345
Joined: Wed 09 Sep 2009 06:55
Location: devart

Post by .jp » Thu 28 Apr 2011 08:21

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.

ivan
Posts: 6
Joined: Thu 28 Apr 2011 06:04

Post by ivan » Thu 28 Apr 2011 08:47

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)?

ivan
Posts: 6
Joined: Thu 28 Apr 2011 06:04

Post by ivan » Thu 28 Apr 2011 09:47

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.

.jp
Devart Team
Posts: 345
Joined: Wed 09 Sep 2009 06:55
Location: devart

Post by .jp » Thu 28 Apr 2011 10:17

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.

ivan
Posts: 6
Joined: Thu 28 Apr 2011 06:04

Post by ivan » Thu 28 Apr 2011 10:45

Cool. It would be very useful.

ivan
Posts: 6
Joined: Thu 28 Apr 2011 06:04

Post by ivan » Mon 02 May 2011 10:43

By the way Does anybody know why schemacompare.com cant be run with ant task or directly with java spawn command?

.jp
Devart Team
Posts: 345
Joined: Wed 09 Sep 2009 06:55
Location: devart

Post by .jp » Tue 10 May 2011 10:36

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"

ivan
Posts: 6
Joined: Thu 28 Apr 2011 06:04

Post by ivan » Tue 10 May 2011 16:59

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.

Post Reply