Duplicate object
PeterHageus
Posts: 11
I get the following ApplicationException when trying to use SQL Compare API against some databases:
"{"A duplicate object name (dbo) has been found. This may occur if the SQL Server that you are registering is case sensitive but the case sensitive option is not set."}"
I really can't find the cause of it. I've tried changing case sensitivity back and forth, but no difference. As far as I can tell I don't have any duplicates in the database at all.
Using the demo of SQL Compare does not exhibit the same problem.
"{"A duplicate object name (dbo) has been found. This may occur if the SQL Server that you are registering is case sensitive but the case sensitive option is not set."}"
I really can't find the cause of it. I've tried changing case sensitivity back and forth, but no difference. As far as I can tell I don't have any duplicates in the database at all.
Using the demo of SQL Compare does not exhibit the same problem.
Comments
If you're using 6.2.0.271 and it's still doing this, I'd like to know more details about exactly what you're doing, so I can track down where the probelm's coming from. e.g. what are the database verisons / types on each side, where in the code is the exception thrown, if possible the code you're using / full stack trace / backups or snapshots or folders with the databases in (to michelle.taylor@red-gate.com for things you don't want to post publically).
Redgate Software
I don't know if I'm missing something, but the distribution of the Toolkit dll's seems quite confusing. First of all, the only download I can find is for the entire Toolbelt, and once installed, the dll's are scattered all around the place. This makes it very difficult to keep track of versions.
You should generally use a single product's set of dlls when using the toolkit - the latest version is generally the best for your task, but if you're using Data Compare functionality you have to use the ones from Data Compare and if you're using Packager functionality you have to use the ones from Packager. I know that this isn't very well signposted at the moment - we're currently looking into changing the way the Toolkit is distributed, which will hopefully include clearer documentation and installation procedures.
Redgate Software
Glad to hear you're working on the distribution issue!
Differences differences = dbSnapshot.CompareWith(dbBak, Options.Default);
I am using the RedGate.SQL.Shared.dll, version 6.2.1.36 from the RedGate Data Compare bundle (all dll's are from 2/5/2008).
The reason for using Data Compare is that if the above test shows the schemas are equal, we will be restoring the .bak file to a DB and doing custom table mappings between it and another DB.
Please let me know if I can provide further info.
Peter's issue was fixed by registering a database object separately for SQL Compare and Data Compare. Registering a single database object for both has this side-effect, so in order to prevent odd things like this, be sure to use only the Database.Register method for a schema comparison and Database.RegisterForDataCompare when using the database object for a data comparison.