Red Gate forums :: View topic - SQL Compare 10 command line from direct source control
Return to www.red-gate.com RSS Feed Available

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

SQL Compare 10 command line from direct source control

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



Joined: 05 Apr 2012
Posts: 4

PostPosted: Thu Apr 05, 2012 3:18 am    Post subject: SQL Compare 10 command line from direct source control Reply with quote

I'm using the following arg file for the command line tool and it throws
"Error: Object reference not set to an instance of an object."

What's wrong with it. Hardly I can find any examples to compare directly from source control.

<?xml version="1.0"?>
<commandline>
<sourcecontrol1>http://server1.mydomain.local:81/svn/P1/tags/Current/2.14.0.24/DBs/My_DB/</sourcecontrol1>
<version1>23431</version1>
<versionusername1>1111</versionusername1>
<versionpassword1>1111</versionpassword1>
<server2>DBserver</server2>
<username2>sa</username2>
<password2>22222</password2>
<database2>My_DB</database2>
<filter>C:\Filters\myfilter.scpf</filter>
</commandline>

Thanks Rolling Eyes
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6581

PostPosted: Mon Apr 09, 2012 3:12 pm    Post subject: Reply with quote

Comparing directly from source control is fairly new and I think the new v10.1 extensions aren't even documented yet.

That said I'll have to double-check this on Tuesday as today is a holiday, but if you want to use source control with SQL Compare, you'll need to use the <scriptsfolderxml> argument to point to the repository. sourcecontrol1 and sourcecontrol2 are scripts folders according to the help (sqlcompare /? /v) so should be pointing to folders on disk as far as I know...

Scriptsfolderxml should point to a file containing the source control repository information.
Code:
<?xml version="1.0" encoding="utf-16" standalone="yes"?>
<ISOCCCompareLocation version="1" type="SvnLocation">
    <RepositoryUrl>
        http://server1.mydomain.local:81/svn/P1/tags/Current/2.14.0.24/DBs/My_DB/
    </RepositoryUrl>
</ISSOCCompareLocation>
Back to top
View user's profile Send private message
kalhara



Joined: 05 Apr 2012
Posts: 4

PostPosted: Tue Apr 10, 2012 1:34 am    Post subject: Reply with quote

It seems scriptsfolderxml is Deprecated method ?
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6581

PostPosted: Tue Apr 10, 2012 9:33 am    Post subject: Reply with quote

I was told migrationsfolderxml was deprecated and replaced by scriptsfolderxml.
Back to top
View user's profile Send private message
David Pond
Site Admin


Joined: 06 Mar 2012
Posts: 14
Location: Cambridge, UK

PostPosted: Wed Apr 11, 2012 1:32 pm    Post subject: Reply with quote

Just to clarify the "deprecated" issue, since this is all my fault. Embarassed

I initially decided to mark /migrationsfolderxml as deprecated because in the use-case I imagined it made more sense for people to use /migrationsfolder. But the feedback suggests that /migrationsfolderxml is actually more useful.

I also accidently marked /scriptfolderxml as deprecated, it is not.

We know this is a complicated part of the commandline and the plan is to improve this area as soon as possible (next month?).
Back to top
View user's profile Send private message
SeanRhone



Joined: 25 Jun 2012
Posts: 11

PostPosted: Tue Jul 31, 2012 9:48 pm    Post subject: Example Reply with quote

Is there an example of command line use of argument file com parings Tfs and SQL database? I would like to set up CI between the Tfs and my development database but cannot seem to get the syntax correct for using a Tfs repository as the source1 and a sql database as source2.

Any help is greatly appreciated!
Back to top
View user's profile Send private message
David Atkinson



Joined: 05 Dec 2005
Posts: 1114
Location: Twitter: @dtabase

PostPosted: Tue Jul 31, 2012 10:44 pm    Post subject: Reply with quote

Would it be possible for you to post your syntax so we can identify what the problem is?

David Atkinson
Red Gate
Back to top
View user's profile Send private message Send e-mail
SeanRhone



Joined: 25 Jun 2012
Posts: 11

PostPosted: Wed Aug 01, 2012 1:23 am    Post subject: setup Reply with quote

I have a file names Testing2.xml which contains the following

<?xml version="1.0"?>
<commandline>
<ISOCCompareLocation version="1" type="TfsLocation">
<RepositoryUrl>
http://server:8080/tfs/legacy/$/Databases/E/Development/QM
</RepositoryUrl>
<ISOCCompareLocation>
</commandline>

calling the

sqlcompare.exe /sourcecontrol1 /revision1:head /scriptsfolderxml:LocationToTesting.xml /database2:QM server2:MySqlDatabaseName

I'm getting an error message that states

Error: Invalid connection database connection parameter: Values cannot be null. Parameter name: scriptFolderLocation

Since I cannot find an example on the syntax, I'm not sure what to change


Last edited by SeanRhone on Wed Aug 01, 2012 2:06 am; edited 1 time in total
Back to top
View user's profile Send private message
SeanRhone



Joined: 25 Jun 2012
Posts: 11

PostPosted: Wed Aug 01, 2012 2:05 am    Post subject: updated file Reply with quote

Found out that the xml was incorrect and chaged to

<?xml version="1.0" encoding="utf-16" standalone="yes"?>
<ISOCCompareLocation version="1" type="TfsLocation">
<ServerUrl>http://Server:8080/tfs/legacy</ServerUrl>
<SourceControlFolder>$/Databases/E/Development/QM</SourceControlFolder>
</ISOCCompareLocation>

Still getting the same error message though
Back to top
View user's profile Send private message
David Atkinson



Joined: 05 Dec 2005
Posts: 1114
Location: Twitter: @dtabase

PostPosted: Wed Aug 01, 2012 2:29 pm    Post subject: Reply with quote

What version of SQL Compare do you have installed? Before we spend too long troubleshooting it might be worth trying the patch referenced here.

http://www.red-gate.com/MessageBoard/viewtopic.php?t=15335

Once thing also worth trying is adding /verbose in case this provides better information.

David
Back to top
View user's profile Send private message Send e-mail
SeanRhone



Joined: 25 Jun 2012
Posts: 11

PostPosted: Wed Aug 01, 2012 3:29 pm    Post subject: That fixed it Reply with quote

Thanks David - After applying that update the command line works now!
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