Error: this key is already associated with an element of this collection

Brian DonahueBrian Donahue Posts: 6,590 New member
edited July 22, 2003 7:38AM in SQL Compare Previous Versions
Hello Vassil,

There could be a lot of reasons for this, but commonly it's because your
database is case-sensitive and you've got two objects that have the same
name, only in a different case. In this scenario, SQL Compare sees them as
duplicate objects. If this isn't the case, please let me know.

Brian Donahue

"Vassil Tochev" <[email protected]> wrote in message
news:[email protected]
> Hello,
> I am having trouble comparing two sql server 7 databases.
> When trying to register the databases, I first choose my server and then
as
> soon as I select my database I get:
> Run time error '457':
> This key is already associated with an element of this collection
>
> Is there a way to avoid this error?
> Thank you,
> Vassil Tochev
>
>

Comments

  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Andrea,

    That's absolutely correct. In the current version, case-differing
    objects with the same name are treated as duplicate objects in the
    collections produced by SQL Compare.

    -Brian Donahue

    "Andrea Montanari" <[email protected]> wrote in message
    news:UK1RmEP#[email protected]
    > Brian,
    > I do not have this problem at all and usually my install are not
    > case-sensitive, but by this do you mean SQL Compare does not support
    objects
    > with same name but different case (and same owner)??
    > tia
    > Andrea Montanari
    > [email protected]
    > http://www.asql.biz/DbaMgr.shtm
    > DbaMgr2k ver 0.3.1 - DbaMgr ver 0.49.1
    > (my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
    > interface)
    >
    remove DMO to reply
    >
    > "Brian Donahue (Red Gate)" <[email protected]> ha scritto nel
    > messaggio news:yPaJKPG#[email protected]
    > > Hello Vassil,
    > >
    > > There could be a lot of reasons for this, but commonly it's because
    > your
    > > database is case-sensitive and you've got two objects that have the same
    > > name, only in a different case. In this scenario, SQL Compare sees them
    as
    > > duplicate objects. If this isn't the case, please let me know.
    > >
    > > Brian Donahue
    > >
    > > "Vassil Tochev" <[email protected]> wrote in message
    > > news:[email protected]
    > > > Hello,
    > > > I am having trouble comparing two sql server 7 databases.
    > > > When trying to register the databases, I first choose my server and
    then
    > > as
    > > > soon as I select my database I get:
    > > > Run time error '457':
    > > > This key is already associated with an element of this collection
    > > >
    > > > Is there a way to avoid this error?
    > > > Thank you,
    > > > Vassil Tochev
    > > >
    > > >
    > >
    > >
    >
    >
  • Brian DonahueBrian Donahue Posts: 6,590 New member
    Hi Jamie,

    Absolutely. There could be corruption in one of the system tables, like
    sysobjects, that's got duplicate object names in it. In one case, there were
    duplicate indexes. You may want to try running DBCC CheckDB against your
    database and see if it finds any inconsistencies.

    Regards,
    Brian Donahue
    Technical Support


    "Jamie" <[email protected]> wrote in message
    news:[email protected]
    > Brian:
    >
    > I've got the same problem. I'm trying to compare an SP1 version of a
    > case-sensitive database to an SP3 version. In doing a schema compare it
    > keeps bombing. The tables are all in lower-case, though, so there
    shouldn't
    > be a conflict between case-sensitive and insensitive names. Any other
    > possible/probable causes to that error message?
    >
    > Thanks.
    >
    > Jamie
    >
    >
    > "Vassil Tochev" <[email protected]> wrote in message
    > news:[email protected]
    > > Hello,
    > > I am having trouble comparing two sql server 7 databases.
    > > When trying to register the databases, I first choose my server and then
    > as
    > > soon as I select my database I get:
    > > Run time error '457':
    > > This key is already associated with an element of this collection
    > >
    > > Is there a way to avoid this error?
    > > Thank you,
    > > Vassil Tochev
    > >
    > >
    >
    >
This discussion has been closed.