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

Brian DonahueBrian Donahue Posts: 6,590 Bronze 1
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" <VTochev@quantum.ca> wrote in message
news:N5CMPTK9CHA.1432@server53...
> 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 Bronze 1
    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" <montanari_andreaNOSPAM@virgilio.it> wrote in message
    news:UK1RmEP#CHA.1156@server53...
    > 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
    > montanari_andrea@virgilio.it
    > 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)" <brian.donahue@red-gate.com> ha scritto nel
    > messaggio news:yPaJKPG#CHA.1432@server53...
    > > 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" <VTochev@quantum.ca> wrote in message
    > > news:N5CMPTK9CHA.1432@server53...
    > > > 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 Bronze 1
    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" <jamie_carroll@hotmail.com> wrote in message
    news:wmStR29SDHA.1200@server53...
    > 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" <VTochev@quantum.ca> wrote in message
    > news:N5CMPTK9CHA.1432@server53...
    > > 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.