Programmable Objects from comparison information: Sequence contains more than one element

While "import and generate script" with SQL server database, getting following error: 

Message = Error updating scripts in folder C:\Project\Apptemetry\CMDB_Database\CMDB\Programmable Objects from comparison information: Sequence contains more than one element
Data = System.Collections.ListDictionaryInternal
InnerException = System.InvalidOperationException: Sequence contains more than one element
   at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source)
   at RedGate.Versioning.Engine.Core.ScriptGeneration.SqlServer.Modification.ReRunnable.RerunnableExtendedPropertiesFixer.BatchIsIfExistsCheck(TSqlBatch batch, IList`1& parameters)
   at RedGate.Versioning.Engine.Core.ScriptGeneration.SqlServer.Modification.ReRunnable.RerunnableExtendedPropertiesFixer.FixExtendedPropertiesRewrites(IWork work, IComparisonInformation comparisonInformation, SqlServerComparisonSettings comparisonSettings, IReadOnlyCollection`1 filesToAlter)
   at RedGate.Versioning.Engine.Core.ScriptGeneration.SqlServer.Modification.ReRunnable.RerunnableExtendedPropertiesFixer.FixExtendedPropertiesRewrites(IWork work, IComparisonInformation comparisonInformation, IComparisonSettings comparisonSettings, IReadOnlyCollection`1 filesToAlter)
   at RedGate.Versioning.Engine.Core.ScriptGeneration.SqlServer.Synchronization.Folder.ScriptFolderSynchronizer.SynchronizeFolder(IComparisonInformation comparisonInformation, FolderSynchronizationSettings folderSynchronizationSettings, IComparisonSettings comparisonSettings, IProgressLogger progress)
   at RedGate.Versioning.Engine.Core.ScriptGeneration.SqlServer.Synchronization.Folder.ScriptFolderSynchronizer.<>c__DisplayClass9_0.<SynchronizeFolderFromDifferences>b__0()
   at RedGate.Versioning.Engine.Core.ScriptGeneration.SqlServer.Synchronization.Folder.ScriptFolderSynchronizer.HandleExceptions(String destinationFolder, Func`1 callback)
TargetSite = System.Collections.Generic.IReadOnlyCollection`1[RedGate.Versioning.Engine.Core.ScriptGeneration.Synchronization.Folder.SynchronizedFile] HandleExceptions(System.String, System.Func`1[System.Collections.Generic.IReadOnlyCollection`1[RedGate.Versioning.Engine.Core.ScriptGeneration.Synchronization.Folder.SynchronizedFile]])
StackTrace =    at RedGate.Versioning.Engine.Core.ScriptGeneration.SqlServer.Synchronization.Folder.ScriptFolderSynchronizer.HandleExceptions(String destinationFolder, Func`1 callback)
   at RedGate.Versioning.Engine.Core.ScriptGeneration.SqlServer.Synchronization.Folder.ScriptFolderSynchronizer.SynchronizeFolderFromDifferences(IComparisonInformation comparisonInformation, IEnumerable`1 differenceIdentifiers, FolderSynchronizationSettings folderSynchronizationSettings, IComparisonSettings comparisonSettings, IProgressLogger progress)
   at RedGate.Versioning.Engines.Interaction.GenerateMigrations.ProgrammableObjects.ProgrammableObjectSynchronizer`1.<>c__DisplayClass7_0.<SyncSpecificProgrammableObjects>b__0(IComparisonInformation schemaDifferences)
   at RedGate.Versioning.Engine.Core.ScriptGeneration.Synchronization.Folder.ScriptFolderComparerAndSynchronizer`1.<SyncDatabaseWithFolder>d__6.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at RedGate.Versioning.Engine.Core.ScriptGeneration.Synchronization.Folder.RerunnableScriptFolderComparerAndSynchronizer`1.<SyncDatabaseWithFolder>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at RedGate.Versioning.Engines.Interaction.GenerateMigrations.ProgrammableObjects.ProgrammableObjectSynchronizer`1.<SyncSpecificProgrammableObjects>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at RedGate.Versioning.Engines.Interaction.GenerateMigrations.Imports.ScriptGenerator`1.<GenerateScripts>d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at RedGate.Versioning.Engines.Interaction.GenerateMigrations.Imports.SchemaModelAwareScriptGenerator.<GenerateScripts>d__5.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at RedGate.Versioning.Engines.Interaction.GenerateMigrations.Imports.ProjectScriptGenerator.<GenerateScripts>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at RedGate.Versioning.Engines.Interaction.GenerateMigrations.Imports.ProjectScriptGeneratorAndImporter.<CreateScripts>d__11.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at RedGate.Versioning.Engines.Interaction.GenerateMigrations.Imports.ProjectScriptsCreator.<CreateScripts>d__2.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at RedGate.Versioning.Client.VsShell.VisualStudio.Commands.SyncCommand.<Synchronize>d__31.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
   at RedGate.Versioning.Client.VsShell.VisualStudio.Commands.SyncCommand.<ExecuteOrThrow>d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at RedGate.Versioning.Client.VsShell.VisualStudio.Commands.SyncCommand.<Execute>d__22.MoveNext()
HelpLink = 
Source = RedGate.Versioning.Engine.Core.ScriptGeneration.SqlServer
HResult = -2146233088
Tagged:

Answers

  • Jessica RJessica R Posts: 1,319 Rose Gold 4
    Thanks for your post and sorry to hear you're running into an issue!

    If you try creating a new project from your development database, I assume you don't have any issue refreshing it. Could you check and confirm that for me?

    If that's the case, it seems the issue may be specific with your project in question. Is it possible to have a copy of your project folder so we can investigate it further? (you can send to support@red-gate.com with subject "For ticket #260791")

    What version of SCA do you have installed?

    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?


  • jreccajrecca Posts: 7 Bronze 1
    I'm also having the same issue here (SCA ver - 4.2.20098.19104):

    Message = Error updating scripts in folder G:\Devel\Projects\VS2017\iFastrack_Sql_Deploy-Test\iFastrack_Sql_Deploy\Programmable Objects from comparison information: Sequence contains more than one element
    Data = System.Collections.ListDictionaryInternal

    So far it seems to happen when I change a SQL view, I can add a new one but not update it.
    I haven't experimented with updating other objects since I started getting this problem.
    I will try generating a new project and see if I can update.
    I have a fair amount of version history so I do not want to create a new one from scratch, but I will try for testing purposes.
  • jreccajrecca Posts: 7 Bronze 1
    I tested changing a table and it worked fine...so far.
  • jreccajrecca Posts: 7 Bronze 1
    I created a a new project using my development database and it still got the error when editing a view.
    ie; Edit view, refresh project then Import and generate script. Error would pop up, preventing process from going any further.
  • alovhaugalovhaug Posts: 7 Bronze 2
    I am also experiencing this same issue with two views that need to be altered.

    I thought perhaps I could temporarily drop the views, import and generate script, and then recreate them, but that also did not work. I also made sure I was updated to the latest version of SQL Change Automation, but the problem persists.

    What can be done? 





  • jreccajrecca Posts: 7 Bronze 1
    I was also not able to drop the views and recreate. I would get the same error as listed.
    How can we fix this?
  • alovhaugalovhaug Posts: 7 Bronze 2
    Other things I have tried:

    Updating to the latest version of SCA
    Updating to the latest version of SQL Compare
    Trying to import each view separately.


    None of these helped.

    Other information:
    I am using programmable objects, and I am using the Visual Studio version of SCA. I tried opening the project in SSMS, but it is showing many more pending changes than what the project (correctly) shows in VS2019.

    I'm stumped. I guess I will need to submit a bug report. :-(

Sign In or Register to comment.