Can I Create an .scomp File From the Command Line?

Discussion of open issues, suggestions and bugs regarding database management and development tools for SQL Server
mango333
Posts: 40
Joined: Thu 14 May 2015 19:23

Can I Create an .scomp File From the Command Line?

Post by mango333 » Thu 17 Sep 2015 16:44

We purchased this tool specifically for its ability to be interacted with on the command line. But I can't seem to find anything in the documentation that states how an .scomp file can be generated from the command line. We are already performing snapshot based schema compares in addition to generating both snapshot files and .sql files. Help please?

alexa

Re: Can I Create an .scomp File From the Command Line?

Post by alexa » Fri 18 Sep 2015 08:19

A *.scomp document is generated in the GUI of dbForge and can be used in the command line interface. It's not intended to be generated from the command line interface https://www.devart.com/dbforge/sql/sche ... cument.htm

mango333
Posts: 40
Joined: Thu 14 May 2015 19:23

Re: Can I Create an .scomp File From the Command Line?

Post by mango333 » Mon 21 Sep 2015 19:55

Hmmm...well that's a problem. This tool was intended to be part of an automated solution to generate SQL builds. Currently I'm performing the compare and then using the /sync switch to generate the .sql files for the changes. But the intent was for code review, not actual synching. Is there no way to generate a *.scomp file outside of the GUI similar to the way *.sql files are generated?

Basically I want to perform the compare and notify a user the comparison file is ready for review.

alexa

Re: Can I Create an .scomp File From the Command Line?

Post by alexa » Tue 22 Sep 2015 07:53

You can generate a comparison report in XLS or HTML formats using either a *.scomp file containing connection details with comparison options or specifying connection information (and comparison options) explicitly. Here is an example:

Code: Select all

C:\Program Files\Devart\dbForge Schema Compare for SQL Server>schemacompare.com /schemacompare /source server:SqlServer1 user:sa password:sa database:db1 /target server:SqlServer2 user:sa password:sa database:db2 /sync:"D:\compare_result.sql" /report:"report.html" /reportformat:HTML /groupby:objecttype
You can find more examples by typing the following in the command line prompt:

Code: Select all

C:\Program Files\Devart\dbForge Schema Compare for SQL Server>schemacompare.com /schemacompare /?
Please also see the following topic in the product's Help documentation https://www.devart.com/dbforge/sql/sche ... d_line.htm

Please let us know if it helps.

mango333
Posts: 40
Joined: Thu 14 May 2015 19:23

Re: Can I Create an .scomp File From the Command Line?

Post by mango333 » Tue 22 Sep 2015 14:37

Thanks Alexa. I'll check out the contents/format of the html report and see if it meets our needs. I'll post the results one way or the other.

mango333
Posts: 40
Joined: Thu 14 May 2015 19:23

Re: Can I Create an .scomp File From the Command Line?

Post by mango333 » Tue 22 Sep 2015 16:16

Ok here is the command I ran in PowerShell, using an argFile that I know works fine because it completed successfully this morning through my automated process. I just changed the file location and added the html report bit.

.\schemacompare /argfile:"I:\TFS_BUILD_OUT\COMPARE\DW\aaaTEST\DataWarehouse_CompareConfig.txt" /report:"I:\TFS_BUILD_OUT\COMPARE\DW\aaaTEST\SampleReportDW.html" /reportformat:HTML /groupby:objecttype

Here is the outcome of running this command:

Synchronization successfully done.

Finished at: 9/22/2015 11:08:26 AM.
Error: Object reference not set to an instance of an object.
[failed to generate error report file]

An html file was created but it contains only a header and generation date with no data. I tried it in both IE 11 and the latest version of Chrome (45). Is there something wrong with my command?

alexa

Re: Can I Create an .scomp File From the Command Line?

Post by alexa » Wed 23 Sep 2015 10:50

Could you please specify full name and version of the product?

mango333
Posts: 40
Joined: Thu 14 May 2015 19:23

Re: Can I Create an .scomp File From the Command Line?

Post by mango333 » Wed 23 Sep 2015 14:26

dbForge Schema Compare for SQL Server ver. 4.0.32

alexa

Re: Can I Create an .scomp File From the Command Line?

Post by alexa » Thu 24 Sep 2015 10:32

Could you please install a fully featured 30-day Trial version of another our product dbForge Studio for SQL Server https://www.devart.com/dbforge/sql/studio/download.html where the Schema Compare feature is included, and try executing the command line which should look as follows:

Code: Select all

\dbforgesql /argfile:"I:\TFS_BUILD_OUT\COMPARE\DW\aaaTEST\DataWarehouse_CompareConfig.txt" /report:"I:\TFS_BUILD_OUT\COMPARE\DW\aaaTEST\SampleReportDW.html" /reportformat:HTML /groupby:objecttype

mango333
Posts: 40
Joined: Thu 14 May 2015 19:23

Re: Can I Create an .scomp File From the Command Line?

Post by mango333 » Thu 24 Sep 2015 14:47

Is the HTML report only available with the support of an additional product?
Last edited by mango333 on Thu 24 Sep 2015 15:27, edited 1 time in total.

mango333
Posts: 40
Joined: Thu 14 May 2015 19:23

Re: Can I Create an .scomp File From the Command Line?

Post by mango333 » Thu 24 Sep 2015 15:27

Also, how hard would it be to create a /comp switch to generate an .scomp file from the command line. I assume you are using all the same libraries to perform the comparison anyway and would just need to add the graphical information. Just curious.

alexa

Re: Can I Create an .scomp File From the Command Line?

Post by alexa » Fri 25 Sep 2015 10:40

Why we asked you to try executing the command line string, is to check if there is a bug in dbForge Schema Compare for SQL Server. You are right saying we use the same libraries in both dbForge Schema Compare for SQL Server and dbForge Studio for SQL Server. But, since dbForge Schema Compare for SQL Server hasn't been updated for longer than dbForge Studio for SQL Server, the bug may be fixed already and, if so, the fix will be included in the next product build.

Also, you can provide us the snapshots of the compared database and we will check it ourselves. However, we understand that may be not possible for reasons of confidentiality.

Regarding generating a *.scomp file, there is no reason to be able to generate it from the command line interface since this file doesn't change dynamically and doesn't contain the data from the compared databases. It includes only the information about the connections, references to the databases and objects to be compared/synchronized. You can open a *. scomp file only with dbForge and when you open it, it starts retrieving the information from the compared databases and comparing them. So, it's not a report. If you open the same *.scomp file (with dbForge) in different time intervals, you will get different results in case the compared databases changed, whereas the *.scomp file is not changed.

mango333
Posts: 40
Joined: Thu 14 May 2015 19:23

Re: Can I Create an .scomp File From the Command Line?

Post by mango333 » Fri 25 Sep 2015 14:10

Thanks for the information Alexa. I plan to do as you suggest once I clear up some other issues. The fact the .scomp does not change may still work for our process. The purpose was to give a code reviewer the ability to drill in a little more than a .sql file allows. If I had a set of .scomp files that encompassed all the instances involved in a build, I could still accomplish this.

I'll let you know how it goes, probably some time early next week.

alexa

Re: Can I Create an .scomp File From the Command Line?

Post by alexa » Fri 25 Sep 2015 14:28

We will be looking forward to your reply.

mango333
Posts: 40
Joined: Thu 14 May 2015 19:23

Re: Can I Create an .scomp File From the Command Line?

Post by mango333 » Fri 25 Sep 2015 16:18

Well, my work was re-prioritized and I performed the install locally and duplicated the files for compare. I was able to successfully generate an HTML report using the Studio version. Thanks Alexa!

Unfortunately, the report does not give me what I was hoping for. But the previous info is enough to get me going again. I am already generating snapshots with each build and using the snapshots to perform the comparisons. I should, in theory, be able to create snapshot based comparisons in the GUI and save these comparison as static .scomp files. I can then replace the target or source snapshot with the new file as needed and the .scomp will "point" to the most recent info. This will provide me a way to give users a "point and click" solution for review.

Do you foresee any issues with this approach?

Post Reply