Programmable Objects from comparison information: Sequence contains more than one element
DeepakU
Posts: 3 New member
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
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?
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.
ie; Edit view, refresh project then Import and generate script. Error would pop up, preventing process from going any further.
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?
How can we fix this?
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. :-(