Hi,
I am trying to compare a live database and a script folder using SQLComapre 7 API. It was working for first few days, but it is suddenly failing with the following error message when I am trying to register the database that represents the scripts folder.
'An item with the same key has already been added.' at
scriptFolderDatabase.Register(parameter.InputFolderPath, dbInfo, databaseOptions)
the full code is :
Options databaseOptions = Options.Default | Options.IgnoreCollations | Options.IgnoreFileGroups | Options.IgnoreFillFactor |
Options.IgnoreWhiteSpace | Options.IgnoreQuotedIdentifiersAndAnsiNullSettings;
Database emptyDatabase = new Database();
emptyDatabase.Register(parameter.ToRedGateConnectionProperty(), databaseOptions);
Database scriptFolderDatabase = new Database();
ReadFromScriptDatabaseInformation dbInfo = new ReadFromScriptDatabaseInformation();
dbInfo.DefaultCollation = "SQL_Latin1_General_CP1_CI_AS";
dbInfo.DefaultOwner = "dbo";
scriptFolderDatabase.Register(parameter.InputFolderPath, dbInfo, databaseOptions);
the stack trace is:
at RedGate.SQLCompare.Rewriter.Analysis.Analyser`1.WaitForBackgroundThread()
at cV.a(FileInfo )
at cV.a()
at RedGate.SQLCompare.Engine.Database.Register(String path, ReadFromScriptDatabaseInformation dbinfo, Options options)
at PwC.Audition.Tools.SQLCompareWrapper.SchemaScriptGenerator.GenerateSchemaScript(SchemaScriptGeneratorParameter parameter) in

\CAR_Audition\Tools\PwC.Audition.Tools.SQLCompareWrapper\SchemaScriptGenerator.cs:line 33
Can anyone please help with that?
I am trying to compare a live database and a script folder using SQLComapre 7 API. It was working for first few days, but it is suddenly failing with the following error message when I am trying to register the database that represents the scripts folder.
'An item with the same key has already been added.' at
scriptFolderDatabase.Register(parameter.InputFolderPath, dbInfo, databaseOptions)
the full code is :
Options databaseOptions = Options.Default | Options.IgnoreCollations | Options.IgnoreFileGroups | Options.IgnoreFillFactor |
Options.IgnoreWhiteSpace | Options.IgnoreQuotedIdentifiersAndAnsiNullSettings;
Database emptyDatabase = new Database();
emptyDatabase.Register(parameter.ToRedGateConnectionProperty(), databaseOptions);
Database scriptFolderDatabase = new Database();
ReadFromScriptDatabaseInformation dbInfo = new ReadFromScriptDatabaseInformation();
dbInfo.DefaultCollation = "SQL_Latin1_General_CP1_CI_AS";
dbInfo.DefaultOwner = "dbo";
scriptFolderDatabase.Register(parameter.InputFolderPath, dbInfo, databaseOptions);
the stack trace is:
at RedGate.SQLCompare.Rewriter.Analysis.Analyser`1.WaitForBackgroundThread()
at cV.a(FileInfo )
at cV.a()
at RedGate.SQLCompare.Engine.Database.Register(String path, ReadFromScriptDatabaseInformation dbinfo, Options options)
at PwC.Audition.Tools.SQLCompareWrapper.SchemaScriptGenerator.GenerateSchemaScript(SchemaScriptGeneratorParameter parameter) in
Can anyone please help with that?