How can i fix "Cannot add duplicate Parameter with key '@debugFlag'"

The error-message occurs after connecting SQL Source Control 7.7.10.18663 to a specific database.
Tagged:

Answers

  • Hi @JeCzerno

    Could you provide a screenshot of the error you're seeing, please?

    Kind regards

    Dan Calver | Redgate Software
    Have you visited our 
    Help Center?

  • JeCzernoJeCzerno Posts: 3 New member
    as text:

    Cannot add duplicate Parameter with key '@debugFlag'.
       at RedGate.SQLCompare.Engine.KeyedCollection`1.Add(T value)
       at RedGate.SQLCompare.Engine.Registration.ReadFromFolder.Factories.StoredProcedureFromFolderFactory.CreateStoredProcedure(Element currentNode, Procedure parsedProc, StoredProcedure& sp, Int32 endOfPreviousStatement)
       at RedGate.SQLCompare.Engine.ReadFromFolder.ReadScriptAnalysis.ProcessNodeCreateOrAlterProcedure(Element currentNode)
       at RedGate.SQLCompare.Engine.ReadFromFolder.ReadScriptAnalysis.TraverseNode(AST node)
       at RedGate.SQLCompare.Engine.ReadFromFolder.ReadScriptAnalysis.TraverseNode(AST node)
       at RedGate.SQLCompare.Engine.ReadFromFolder.ReadScriptAnalysis.VisitNode(Element node, AnalysisProvider`1 provider)
       at RedGate.SQLCompare.Rewriter.Analysis.Analyser`1.AnalyseNode(Element root)
       at RedGate.SQLCompare.Rewriter.Analysis.Analyser`1.Analyse(IEnumerable`1 elements)
       at RedGate.SQLCompare.Engine.ReadFromFolder.DatabaseFromParseResultPopulator.AddToModel(FileInfo file, ParseResult parseResult, ReadScriptAnalysis analysis, LazyFileContents fullFileText, Boolean throwOnFileParseFailed, List`1 parserMessages)
       at RedGate.SQLCompare.Engine.ReadFromFolder.DatabaseFromParseResultPopulator.Populate(ParseResult parseResult)
       at RedGate.SQLCompare.Engine.ReadFromFolder.DatabaseFromScriptFilesPopulator.AddFromFiles(List`1 sortedFiles)
       at RedGate.SQLCompare.Engine.ReadFromFolder.DatabaseFromScriptFilesPopulator.Populate(IEnumerable`1 filesToUse)
       at RedGate.SQLCompare.Engine.Model.DatabaseObjects.DatabaseFromFolderPopulator.DatabaseFromFolderPopulator.PopulateFromFolder(Database database, DirectoryInfo path, ScriptDatabaseInformation dbinfo, Options options, IEnumerable`1 filesToUse, IReadFromFolderCache cache, CancellationToken cancellationToken)
       at RedGate.SQLCompare.Engine.Model.DatabaseObjects.DatabaseFromFolderPopulator.DatabaseFromFolderPopulator.Populate(String path, CancellationToken cancellationToken)
       at RedGate.SQLSourceControl.Engine.CompareEngineImpl.Registration.Incremental.ScriptsFolder.DatabaseFromSnapshotCachePopulator.Populate(String path, CancellationToken cancellationToken)
       at RedGate.SQLCompare.Engine.Database.<>c__DisplayClass126_0.<Register>b__0()
       at RedGate.SQLCompare.Engine.Utils.GetTimeToRun[T](Func`1 action)
       at RedGate.SQLCompare.Engine.Database.Register(String path, ScriptDatabaseInformation dbinfo, Nullable`1 optionsParam, IEnumerable`1 filesToUse, IReadFromFolderCache cache, IDatabaseFromFolderPopulator databasePopulator)
       at RedGate.SQLSourceControl.Engine.CompareEngineImpl.Compare.CompareDatabase.RegisterScriptsFolder(DirectoryInfo path, ICompareScriptDatabaseInformation scriptFolderOptions, ICompareOptions options)
       at RedGate.SQLSourceControl.Engine.Diff.DiffBuildSessions.CompareDatabaseRegistrar.<>c__DisplayClass4_0.<Register>b__0()
       at RedGate.SQLSourceControl.Engine.Utils.Task.SharedUtilsUtils.DoActionWithCancel(ICancellableOperationStatus status, ICancellable cancellable, Action action)
       at RedGate.SQLSourceControl.Engine.Diff.DiffBuildSessions.CompareDatabaseRegistrar.Register(ScriptsFolderDatabaseSource source, ICancellableOperationStatus status)
       at RedGate.SQLSourceControl.Engine.Diff.DiffBuildSessions.SocDatabaseRegistrar.Register(ScriptsFolderDatabaseSource databaseSource, ICancellableOperationStatus status)
       at RedGate.SQLSourceControl.Engine.Diff.DiffBuildSessions.ThreeWorkspaceRegistrar.GetTwoWayDiffBuildSessionTransient(ScriptsFolderDatabaseSource scriptsFolderDatabaseSource)
       at RedGate.SQLSourceControl.Engine.Diff.DiffBuildSessions.ThreeWorkspaceRegistrar.<>c__DisplayClass7_0.<GetRegisterWorkspacesActions>b__0(ICancellableOperationStatus s)
       at RedGate.SQLSourceControl.Engine.Utils.Task.NamedOperation.Operation(ICancellableOperationStatus cancellableOperation)
       at RedGate.SQLSourceControl.Engine.Utils.Task.CancellableUtils.<>c__DisplayClass3_0.<StartTask>b__0()
       at RedGate.SQLSourceControl.Engine.Utils.Task.CancellableUtils.ExceptionHandler.ThrowIfErrored()
       at RedGate.SQLSourceControl.Engine.Utils.Task.CancellableUtils.DoInParallel(ICancellableOperationStatus status, INamedOperation[] namedActions)
       at RedGate.SQLSourceControl.Engine.Diff.DiffBuildSessions.TwoWorkspaceRegistrar.RegisterWorkspaces(IWorkspaces workspaces, ICompareScriptDatabaseInformation scriptDatabaseInformation)
       at RedGate.SQLSourceControl.Engine.Diff.DiffBuildSessions.ThreeWayDiffSession.RegisterWorkspaces(IWorkspaces workspaces, SourceControlRevision transientRevision)
       at RedGate.SQLSourceControl.Engine.Diff.DiffBuildSessions.ThreeWayDiffSession.BuildCommon()
       at RedGate.SQLSourceControl.Engine.Diff.DiffBuildSessions.DiffBuilder.GetChangeSetResolvingNoOps[T](String source, IBoundDatabase boundDatabase, IChangeSetFactory`1 changeSetFactory, ICancellableOperationStatus status, SourceControlOperation sourceControlOperation)
       at RedGate.SQLSourceControl.Engine.Diff.DiffBuildSessions.DiffBuilder.BuildToCommitChangeSet(IBoundDatabase boundDatabase, ICancellableOperationStatus status)
       at RedGate.SQLSourceControl.Engine.Diff.BoundDatabase.<GetCancellableCommitableChanges>b__24_0(ICancellableOperationStatus status)
       at RedGate.SQLSourceControl.Engine.Utils.Task.MutexedCancellableOperation`1.<>c__DisplayClass7_0.<Invoke>b__0()
       at RedGate.SQLSourceControl.Engine.Utils.Task.CancellableOperationBase.PerformAction(Action action)
       at RedGate.SQLSourceControl.Engine.Utils.Task.CancellableOperationBase.InvokeWithTracker(Action action)
       at RedGate.SQLSourceControl.Engine.Utils.Task.MutexedCancellableOperation`1.Invoke()
       at RedGate.SQLSourceControl.Engine.Diff.BoundDatabase.RunCommitableChangesOperationThenCleanUp(ICancellableOperation`1 changes)
       at RedGate.SQLSourceControl.Engine.Diff.BoundDatabase.<>c__DisplayClass40_0.<NotifyInteractedWith>b__1()
       at RedGate.SQLSourceControl.Engine.Utils.ErrorReporting.ErrorReporterBase.Do(Action toDo, Predicate`1 isFatalPredicate, Boolean rethrow)
  • Hi @JeCzerno

    Thanks for providing that info!

    In this case, I would need a schema only copy of the database to troubleshoot this further.

    I'm going to reach out via a support ticket to have a look into this. 

    Kind regards

    Dan Calver | Redgate Software
    Have you visited our 
    Help Center?

  • WeweWewe Posts: 10 New member
    This was a brilliant read. Very detailed and helpful. URL
Sign In or Register to comment.