Duplicate object

PeterHageusPeterHageus Posts: 11
edited June 1, 2008 3:23PM in SQL Toolkit Previous Versions
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.


  • What version of the API do you have there? Early versions of v6 had a couple of problems when saving certain databases to scripts, which would end up with them writing out a 'dbo' and a 'DBO' schema, causing the error you're seeing, and previous versions have had similar problems synchronizing 2000 and 2005 databases.

    If you're using 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 [email protected] for things you don't want to post publically).
    Software Developer
    Redgate Software
  • It seems like I have version or (depending on if I look under Compare or Data Compare dir. Seems odd Data Compare has a newer version). I'm using a SQL 2005 snapshot to update a 2000 server so this is likely to be the problem. I'll try to mail a complete description tomorrow.

    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.
  • Data Compare has a newer version because we're almost constantly developing the SQL Compare Engine, and as Data Compare is currently the later release it has the most up to date released version of the SQL Compare Engine.

    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.
    Software Developer
    Redgate Software
  • I have sent files wich should be able to duplicate the problem. It seems to be a problem specific to 2005 -> 2000 as fas as I can tell.

    Glad to hear you're working on the distribution issue!
  • I am having a very similar problem. In a nutshell we are trying to compare a snapshot file to a .bak file and test for differences. The error occurs on the line:

    Differences differences = dbSnapshot.CompareWith(dbBak, Options.Default);

    I am using the RedGate.SQL.Shared.dll, version 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.
  • Brian DonahueBrian Donahue Posts: 6,590 New member

    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.
Sign In or Register to comment.