Extra objects created when comparing scripts folders via CLI
philhelmer
Posts: 7
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...
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.
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.
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.
"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
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.
If you are doing this, use the "exported" contents of the repository rather than a folder where content was "checked out".
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.
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.
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.