Options

Extra objects created when comparing scripts folders via CLI

philhelmerphilhelmer Posts: 7
edited September 12, 2012 6:37AM in SQL Data Compare Previous Versions
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...
"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.
<?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.
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.

Comments

  • Options
    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.
  • Options
    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".
  • Options
    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.
  • Options
    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.
  • Options
    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.
  • Options
    If RGTEMP is not set, it uses the %TMP% location.
Sign In or Register to comment.