Command Line unable to read script folder XML

Compares and synchronizes SQL Server databases, backups and scripts.

Moderators: JonathanWatts, Chris Auckland, David Atkinson, eddie davis, Anu Deshpande, Michelle Taylor, alice.easey, james.billings, chengvoon.tong

Command Line unable to read script folder XML

Postby Xaphan » Thu Mar 14, 2013 1:26 am

I'm calling the SQL Compare command line in my CI build process to deploy a database. My database source is a database located on Team Foundation Server source control and my destination is to a SQL server. To provide SQL compare with the connection to Team Foundation Serveris I'm providing an XML file to the command line using the "scriptsfolderxml" switch. The problem is that I get the following error back...

Error: The file 'Automated.sfx' containing the script folder location XML
fragment could not be parsed. Check that the file exists and that its contents
are well-formed.


As far as I can tell my XML (which I named Automated.xml) is well formatted. It is also in the location of the working folder that I use to call the SQL Compare command line. Here is what my XML looks like (I changed the folder names for the sake of this post)...

Code: Select all
<?xml version="1.0" encoding="utf-16" standalone="yes"?>
<ISOCCompareLocation version="1" type="TfsLocation">
  <ServerUrl>http://MyServer/MyRespository</ServerUrl>   
  <SourceControlFolder>$/MySourceControlFolder</SourceControlFolder>
</ISOCCompareLocation>


My command line arguments look like this...

Code: Select all
/sourcecontrol1 /revision1:HEAD /sfx:Automated.xml /s2:MyDestinationServer /db2 MyDatabaseName + " /o:Default /Include:identical /sf:MigrationScript.sql /sync"


From what I can tell this should just work. What am I missing here?[/code]
Xaphan
 
Posts: 12
Joined: Fri Apr 20, 2012 11:34 pm

Postby Brian Donahue » Mon Mar 18, 2013 4:15 pm

Hello,

The file format looks okay, so I think it's either the file name being incorrect or a relative path issue.

The error message you quoted mentions a file with an .sfx extension and the command-line shows an .xml file extension.

If that was a typo, can you spacify the full path to the XML file in the SQL Compare command? Every build system I've been exposed to expose some variables that you can use to get to the various working directories of the build system, for instance ($ProjectDir) in MSBUILD.
Brian Donahue
 
Posts: 6670
Joined: Mon Aug 23, 2004 10:48 am

Postby Xaphan » Fri Apr 05, 2013 12:47 am

Thanks for the reply. I looked in to this issue further and here is what I found... I was able to get SQL Compare to work with the following command line on my personal workstation:

Code: Select all
"C:\\Program Files (x86)\\Red Gate\\SQL Compare 10\\sqlcompare.exe" /sourcecontrol1 /revision1:HEAD /s2:MyDatabaseServer /db2:MyDatabaseName /o:Default /Include:identical /sfx:Automated.xml /sync


Automated.xml was located in the directory that I ran the command line from. I tried this again on my build server using the exact same command and got the following error:

Error: The file 'Automated.xml' containing the script folder location XML fragment could not be parsed. Check that the file exists and that its contents are well-formed.

My build server has both SQL Compare and SQL Source Control installed and they are both the same version as on my workstation. They also are located in the same directory. The Automated.xml is also located in the directory where I am calling the the command line from on the build server.

Why is my workstation running the command prompt without errors, but the exact same command is giving me error on my build machine? Does my build machine need something installed or setup in order to make it work?
Xaphan
 
Posts: 12
Joined: Fri Apr 20, 2012 11:34 pm

Postby Xaphan » Tue Apr 09, 2013 7:58 pm

I realized that this ticket was closed before I posted my last response. I have re-posted the response as a new issue to...

http://www.red-gate.com/MessageBoard/viewtopic.php?p=61215#61215
Xaphan
 
Posts: 12
Joined: Fri Apr 20, 2012 11:34 pm


Return to SQL Compare 10

Who is online

Users browsing this forum: No registered users and 1 guest