Extra objects created when comparing scripts folders via CLI

Compares and synchronizes SQL database content.

Moderators: JonathanWatts, Chris Auckland, David Atkinson, Michelle Taylor, chengvoon.tong

Extra objects created when comparing scripts folders via CLI

Postby philhelmer » Wed Sep 05, 2012 7:44 pm

I am running a data compare between 2 scripts folders (SDC Pro 10.2.0.885). The folder trees were created by SQL Source Control and checked out from SVN. This is the command line I'm using...

Code: Select all
"C:\\Program Files (x86)\\Red Gate\\SQL Data Compare 10\\SQLDataCompare.exe" /Argfile:"ArgFiles\\DBName_Data.xml"


This is the content of DBName_Data.xml (edited for clarity). Each of the paths specified in the scripts tags has an immediate child folder "Data", along with the other expected subfolders.

Code: Select all
<?xml version="1.0"?>
   <commandline>

      <scripts1>D:\\...\\ver_current\\...\\DBName</scripts1>
      <scripts2>D:\\...\\ver_prev\\...\\DBName</scripts2>

      <!--Comparison behavior -->
      <include>Missing,Different,Additional</include>
      <include>Table:Table1Name|Table2Name|Table3Name</include>
      
      <options>IncludeIdentities</options>
      <showWarnings />
      
      
      <!-- SQL Data Compare output -->
      <out>Comparison Logs\\DBName_Data.txt</out>
      <verbose />
      <force />
      <outputwidth>120</outputwidth>
      
      <!-- SQL sync script -->
      <scriptfile>SQL Scripts\\DBName_Data.sql</scriptfile>
      
      <!-- Comparison report -->
      <export>Comparison Reports\\DBName_Data</export>
      <outputProject>Comparison Projects\\DBName.sdc</outputProject>
      
   </commandline>


The comparison itself works fine and all of the output files are correct. But, each time I run it, a new folder is added to the \\Data folder (in the scripts2 tree) which contains a .sql and .sdcs file for each table that had a change detected.

Because of this, the output logged in the <out> file contains error messages for each copy of the .sql file that was created in those new folders, for each line in the file.

Code: Select all
Warning: Ignored statement found in file D:\\...\\ver_prev\\db\\...\\DBName\\Data\\634824408469713020\\dbo.Table2Name_Data.sql
at line 1


Is it safe to ignore these messages? Do I need to delete those subfolders before each comparison run?

Lastly, does SQL Data Compare look at the ...\\Data\\SchemaName.TableName_Data.sql file each time or does it only use the .sdcs?

Thank you.
philhelmer
 
Posts: 6
Joined: Thu Dec 01, 2011 8:04 pm

Postby Brian Donahue » Thu Sep 06, 2012 4:00 pm

Sorry to say, I could not reproduce this issue. I took a folder from source control, made a copy, changed some data, and ran basically the same commands that you did and no new folders were created. It must be something odd about that particular folder structure. You can try adding the <LogLevel>Verbose</LogLevel> and check the %userprofile%\\appdata\\local\\red gate\\log\\sql data compare 10 folder. Maybe the log will explain what's happening.

When Data Compare reads folders, it reads the .sql file to gather up the inserts that comprise the data in the table and it constructs an .sdcs file as an index to that data.
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Postby Brian Donahue » Tue Sep 11, 2012 5:39 pm

I've been working on some other source control failures today and I did notice something - if you compare a local folder where you have checked out files (ie the folder contains stuff from the source control system, like the db folder of SVN, etc), this seems to result in "random fail" (ie something bad will happen, but it's something different every time).

If you are doing this, use the "exported" contents of the repository rather than a folder where content was "checked out".
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Postby philhelmer » Tue Sep 11, 2012 7:22 pm

I tried the same data comparison, but using exported folders as per your suggestions. I verified that the tree truly was an export and did not contain any subversion control files. The older version's tree still exhibits the originally reported behavior. :(

As I metioned in the original post, this does not seem to affect the results. It adds some small files to the tree, which produce warnings in the comparison output. The more important artifacts (SQL scripts, CSV summaries, SDC files) appear to be correct.

With regard to the new, numerically-named folder, does that behavior match up with expected product behavior? If it does, it would seem that the issue is cleaning up temporary files.
philhelmer
 
Posts: 6
Joined: Thu Dec 01, 2011 8:04 pm

Postby Brian Donahue » Wed Sep 12, 2012 9:25 am

I can't possibly comment, as I cannot recreate the issue.

Would make sense if you set the RGTEMP environment variable to point to the source folder. That's the only thing I can think of.
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Postby philhelmer » Wed Sep 12, 2012 9:31 am

So the product is supposed to create those folders and clean them up? Is there a default location defined in the code if an RGTEMP doesn't exist? I do not have an env variable defined for RGTEMP (Windows 2008r2 Standard).

Is there any other place from which the software would pick up such a path? I keep wondering if there's any relationship to the fact that the trees contain SSC control files.

Thank you for your help. I know how frustrating it can be when an issue cannot be reproduced easily.
philhelmer
 
Posts: 6
Joined: Thu Dec 01, 2011 8:04 pm

Postby Brian Donahue » Wed Sep 12, 2012 11:37 am

If RGTEMP is not set, it uses the %TMP% location.
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am


Return to SQL Data Compare 10

Who is online

Users browsing this forum: No registered users and 1 guest