Red Gate forums :: View topic - Extra objects created when comparing scripts folders via CLI
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Data Compare 10
SQL Data Compare 10 forum

Extra objects created when comparing scripts folders via CLI

Search in SQL Data Compare 10 forum
Post new topic   Reply to topic
Jump to:  
Author Message
philhelmer



Joined: 01 Dec 2011
Posts: 6

PostPosted: Wed Sep 05, 2012 7:44 pm    Post subject: Extra objects created when comparing scripts folders via CLI Reply with quote

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:
"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:
<?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:
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.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6669

PostPosted: Thu Sep 06, 2012 4:00 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6669

PostPosted: Tue Sep 11, 2012 5:39 pm    Post subject: Reply with quote

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".
Back to top
View user's profile Send private message
philhelmer



Joined: 01 Dec 2011
Posts: 6

PostPosted: Tue Sep 11, 2012 7:22 pm    Post subject: Reply with quote

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. Sad

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.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6669

PostPosted: Wed Sep 12, 2012 9:25 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
philhelmer



Joined: 01 Dec 2011
Posts: 6

PostPosted: Wed Sep 12, 2012 9:31 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6669

PostPosted: Wed Sep 12, 2012 11:37 am    Post subject: Reply with quote

If RGTEMP is not set, it uses the %TMP% location.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group