Is there a worked example comparing two revisions in a Git repository with cli? I am getting error
jschwarz_continuus
Posts: 10 New member
in SQL Compare
I can compare the two revisions via the Gui and get both a report and a sql script successfully. When I attempt via the cli I get an error.
here is my cli...
SQLCompare.exe /sourcecontrol1 /revision1:6131c2ceedfa84065d1f392aa536cb3f897594d4 /sourcecontrol2 /revision2:07ee3506ef4832e33fad4510c8f59f472db66e30 /ScriptsFolderXML:D:\DatabaseRepositories\MarkitDEMO-SourceLib.xml /report:d:\Temp\MarkitDEMO_CompareTest1.html /reportType:Classic /Include:table /Include:table:[dbo].[DeployVersionControlTest] /ScriptFile:d:\Temp\MarkitDemo_CompareTest1.sql
I've also tried this variation with brackets and back slashes first, but got the same error...
SQLCompare.exe /sourcecontrol1 /revision1:6131c2ceedfa84065d1f392aa536cb3f897594d4 /sourcecontrol2 /revision2:07ee3506ef4832e33fad4510c8f59f472db66e30 /ScriptsFolderXML:D:\DatabaseRepositories\MarkitDEMO-SourceLib.xml /Report:d:\Temp\MarkitDEMO_CompareTest1.html /ReportType:Classic /Include:table /Include:table:\[dbo\]\.\[DeployVersionControlTest\] /LogLevel:Verbose /ScriptFile:d:\Temp\MarkitDemo_CompareTest1.sql
Here is my error...
here is my cli...
SQLCompare.exe /sourcecontrol1 /revision1:6131c2ceedfa84065d1f392aa536cb3f897594d4 /sourcecontrol2 /revision2:07ee3506ef4832e33fad4510c8f59f472db66e30 /ScriptsFolderXML:D:\DatabaseRepositories\MarkitDEMO-SourceLib.xml /report:d:\Temp\MarkitDEMO_CompareTest1.html /reportType:Classic /Include:table /Include:table:[dbo].[DeployVersionControlTest] /ScriptFile:d:\Temp\MarkitDemo_CompareTest1.sql
I've also tried this variation with brackets and back slashes first, but got the same error...
SQLCompare.exe /sourcecontrol1 /revision1:6131c2ceedfa84065d1f392aa536cb3f897594d4 /sourcecontrol2 /revision2:07ee3506ef4832e33fad4510c8f59f472db66e30 /ScriptsFolderXML:D:\DatabaseRepositories\MarkitDEMO-SourceLib.xml /Report:d:\Temp\MarkitDEMO_CompareTest1.html /ReportType:Classic /Include:table /Include:table:\[dbo\]\.\[DeployVersionControlTest\] /LogLevel:Verbose /ScriptFile:d:\Temp\MarkitDemo_CompareTest1.sql
Here is my error...
SQL Compare Command Line V13.7.7.10021
=====================================================================================================================================================================================
Copyright Copyright c Red Gate Software Ltd 2019
SQL Compare: activated, edition professional, serial number:
Registering data sources
Creating mappings
Comparing
Applying Command Line Items
Retrieving migration scripts
Error: Comparison of '.' and '.' failed: Input string was not in a correct format.
Comparison of '.' and '.' failed: Input string was not in a correct format.
RedGate.Legacy.CommandLine.FatalExecutionException
at RedGate.SQLToolsCommandLine.CommandProcessor.FatalExceptionHelper(String message, Exception ex)
at RedGate.SQLToolsCommandLine.CommandProcessor.ProcessThreadException(Exception e)
at RedGate.SQLToolsCommandLine.CommandProcessor.ProcessThreadException()
at RedGate.SQLToolsCommandLine.CommandProcessor.RunComparison()
at RedGate.SQLToolsCommandLine.CommandProcessor.ProcessCommands()
at RedGate.SQLCompare.CommandLine.SchemaCommandProcessor.ProcessCommands()
at RedGate.SQLToolsCommandLine.CommandProcessor.Run()
Caused by:
Input string was not in a correct format.
System.FormatException
at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt64(String value, NumberStyles options, NumberFormatInfo numfmt)
at RedGate.SQLCompare.Engine.Migrations.VersionedSynchronizationPlanner.GetPlan(VersionInfo fromVersion, VersionInfo toVersion, IEnumerable`1 migScripts, Boolean toLiveDb)
at RedGate.SQLCompare.Common.WorkProvider.Initialize(IEnumerable`1 migrationScripts, Boolean filterBySelectedDifferences, Boolean updatingScriptFolder)
at RedGate.SQLCompare.Common.CompareEngineExecutor`1.InitializeWorkProvider(IEnumerable`1 selectedMigrationScripts, Boolean filterBySelectedDifferences, Boolean updatingScriptFolder)
at RedGate.SQLCompare.CommandLine.CommandLineCompareEngineController.<PrefetchMigrationScripts>b__21_0()
at RedGate.Legacy.ProgressTasks.SimpleProgressTaskExecutor.DoTasks()
Tagged:
Best Answer
-
Alex B Posts: 1,157 Diamond 4Hi @jschwarz_continuus ,
I've gone through some further checking while waiting for feedback from the team and the UI works properly, so it's not the issue I thought it might be. It now appears to be related to looking for migration scripts (even if there are none). If you add the/Options
switch with the "IgnoreMigrationScripts" option it works successfully.
So something like this will keep the default options and also ignore migration scripts:sqlcompare.exe /sourcecontrol1 /revision1:b4ae0114ef0794852cdb01f320844e7ebd88af85 /sourcecontrol2 /revision2:5409fc1eaa3f9b37ab08d8f9d002b24c81c267c7 /ScriptsFolderXML:"E:\ZD Ticket Files\Z138997\MarkitDEMO-SourceLib.xml" /Options:Default,IgnoreMigrationScripts /LogLevel:verbose
If you do not use migration scripts in your SQL Source Control project then this is an option to workaround the issue. I've created a new internal issue for this as SC-10531 and will update you on that when I have more information from the team.
Kind regards,
Alex
Answers
I have tried the cli using a straight db to db compare, and it completes successfully...
SQLCompare.exe /server1:SERVERNAME1 /database1:DBNAME_DEV /server2:SERVERNAME2 /database2:DBNAME_TEST /Report:d:\Temp\MarkitDEMO_CompareTest_DbToDb.html /ReportType:Classic /Include:table /Include:table:\[dbo\]\.\[DeployVersionControlTest\] /LogLevel:Verbose /ScriptFile:d:\Temp\MarkitDemo_CompareTest_DbToDb.sql
SQL Compare Command Line V13.7.7.10021
=====================================================================================================================================================================================
Copyright Copyright c Red Gate Software Ltd 2019
SQL Compare: activated, edition professional, serial number:
Registering data sources
Creating mappings
Comparing
Applying Command Line Items
Retrieving migration scripts
Generating report
Checking for identical databases
Creating SQL
Saving SQL
Summary Information
======================================================================================================================================================================================
DB1 = SERVERNAME1.DBNAME_DEV
DB2 = SERVERNAME2.DBNAME_TEST
Object type Name DB1 DB2
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Table [dbo].[DeployVersionControlTest] >>
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
I just replied to your support ticket, but also saw this here.
I've reproduced the issue and for everyone else it seems this is related to the git revisions being alphanumeric rather than just numeric as it works when comparing to the HEAD revision or in SVN where the revisions are numbers.
I believe this is related to an existing issue with internal reference SC-8293 and have added a reference to it there and will update the ticket and here when I have further information.
Kind regards,
Alex
Have you visited our Help Center?
I have tested this solution, and it works great!
Thank you for the quick resolution!