none
SQL Server 2008 - "An item with the same key has already been added"

    Question

  • Hello,

    While trying to perform various tasks on the system, including important ones like backing up and restoring databases, I get the following message:

    Message Box Title - "Microsoft SQL Server Management Studio"

    Message - "An item with the same key has already been added (mscorlib)"

    I have followed the other threads and made sure that the system has all updates and service packs applied to the operating system as well as the SQL Server instance. I have restarted the system as well to no avail.

    What do I need to do to get this issue resolved?

    Thank you for your time.

    Regards,

    Christopher Koeber


    Regards, Christopher K.
    • Moved by Tom Phillips Friday, November 19, 2010 3:36 PM Tools question (From:SQL Server Database Engine)
    Friday, November 19, 2010 3:00 AM

Answers

  • Chris, I see that you mentioned applying updates "to the operating system as well as the SQL Server instance".

    Assuming that you work from SSMS on your desktop, not directly on the server then:  Did you also update your desktop tools to the same level? 

    If not, please also do that.  (I don't know this problem, but I know that there are times when backlevel tools can fail even though the server itself is fixed.)

    Just a suggestion.  FWIW, it certainly seems that you are hitting a bug.

    RLF


    I can certainly do that but the problem is happening on the server as well. Would it matter for EVERY instance of the SQL Server Management Studio that connects to the server?

    I find it unlikely, especially since I can do a backup or restore from console.

    Thanks


    Regards, Christopher K.
    Monday, November 22, 2010 7:39 PM
  • Hello Chris,

     Is you server level collation case sensitive and do you have two Databases with the same name but different Case (Upper, Lower).

    Run select * from sys.sysdatabases and post the result.

     

    regards

     

    • Proposed as answer by SQLWorkMVP Wednesday, November 24, 2010 7:03 PM
    • Marked as answer by ckoeber Saturday, November 27, 2010 5:40 PM
    Wednesday, November 24, 2010 5:26 AM

All replies

  • Hi Christopher,

     

    Just tell me what you try to do exactly and what is the issue you facing on it. Are you try to make Maintenance plan or creating job . .  ?


    Thiru - MS SQL World Regards, RM Thirunavukkarasu MCP, MCITP, ITIL V3 | "http://thiruna.blog.com" |Click "Propose As Answer" if solution is helpful to you.
    Friday, November 19, 2010 3:33 AM
  • The problem occurs when I try to backup or restore a database. Thanks.
    Regards, Christopher K.
    Friday, November 19, 2010 3:03 PM
  • Hi ckoeber,

     

    How did you backup or restore database?

    If you are using statement, please provide us the statement you use.

    If you backup or restore database by using SQL Server Management Studio, please provide us the steps in detail.

     

    If anything is unclear, please let me know.


    Regards,
    Tom Li
    Monday, November 22, 2010 7:26 AM
  • Hi ckoeber,

     

    How did you backup or restore database?

    If you are using statement, please provide us the statement you use.

    If you backup or restore database by using SQL Server Management Studio, please provide us the steps in detail.

     

    If anything is unclear, please let me know.


    Regards,
    Tom Li

    I am using the SQL Server Management Studio.

    I just attempt to right click on the "Databases" folder and then click on "Restore Database...".

    After that, I type in the name of the database I wish to restore to, select the file that I am trying to restore from, and then click on OK.

    The message "An item with the same key has already been added (mscorlib)" comes up and I cannot proceed any further.

    Also, if I right-click on a database and then select "Tasks" and then click on "Backup", the same thing happens.

    Anything else I can try?

    Thanks.


    Regards, Christopher K.
    Monday, November 22, 2010 3:22 PM
  • Chris, I see that you mentioned applying updates "to the operating system as well as the SQL Server instance".

    Assuming that you work from SSMS on your desktop, not directly on the server then:  Did you also update your desktop tools to the same level? 

    If not, please also do that.  (I don't know this problem, but I know that there are times when backlevel tools can fail even though the server itself is fixed.)

    Just a suggestion.  FWIW, it certainly seems that you are hitting a bug.

    RLF

    Monday, November 22, 2010 4:07 PM
  • Chris, I see that you mentioned applying updates "to the operating system as well as the SQL Server instance".

    Assuming that you work from SSMS on your desktop, not directly on the server then:  Did you also update your desktop tools to the same level? 

    If not, please also do that.  (I don't know this problem, but I know that there are times when backlevel tools can fail even though the server itself is fixed.)

    Just a suggestion.  FWIW, it certainly seems that you are hitting a bug.

    RLF


    I can certainly do that but the problem is happening on the server as well. Would it matter for EVERY instance of the SQL Server Management Studio that connects to the server?

    I find it unlikely, especially since I can do a backup or restore from console.

    Thanks


    Regards, Christopher K.
    Monday, November 22, 2010 7:39 PM
  • Chris, I see that you mentioned applying updates "to the operating system as well as the SQL Server instance".

    Assuming that you work from SSMS on your desktop, not directly on the server then:  Did you also update your desktop tools to the same level? 

    If not, please also do that.  (I don't know this problem, but I know that there are times when backlevel tools can fail even though the server itself is fixed.)

    Just a suggestion.  FWIW, it certainly seems that you are hitting a bug.

    RLF


    I can certainly do that but the problem is happening on the server as well. Would it matter for EVERY instance of the SQL Server Management Studio that connects to the server?

    I find it unlikely, especially since I can do a backup or restore from console.

    Thanks


    Regards, Christopher K.

    Correction, I CANNOT do a backup or restore from the server. I would like to.
    Regards, Christopher K.
    Monday, November 22, 2010 8:02 PM
  • Chris, I see that you mentioned applying updates "to the operating system as well as the SQL Server instance".

    Assuming that you work from SSMS on your desktop, not directly on the server then:  Did you also update your desktop tools to the same level? 

    If not, please also do that.  (I don't know this problem, but I know that there are times when backlevel tools can fail even though the server itself is fixed.)

    Just a suggestion.  FWIW, it certainly seems that you are hitting a bug.

    RLF

    OK, I updated my desktop where I have the SQL Server Management Studio and I have the exact same issue as well.

    Any other ideas?

    Thanks.


    Regards, Christopher K.
    Monday, November 22, 2010 9:13 PM
  • NOW, I upgraded the systems in question (both the server and clients) to SQL Server 2008 R2 and I STILL have the same exact problem.

    Anything else I can try?

    Thanks.

    Regards,

    Christopher Koeber


    Regards, Christopher K.
    Tuesday, November 23, 2010 11:23 PM
  • Hello Chris,

     Is you server level collation case sensitive and do you have two Databases with the same name but different Case (Upper, Lower).

    Run select * from sys.sysdatabases and post the result.

     

    regards

     

    • Proposed as answer by SQLWorkMVP Wednesday, November 24, 2010 7:03 PM
    • Marked as answer by ckoeber Saturday, November 27, 2010 5:40 PM
    Wednesday, November 24, 2010 5:26 AM
  • Hello Chris,

     Is you server level collation case sensitive and do you have two Databases with the same name but different Case (Upper, Lower).

    Run select * from sys.sysdatabases and post the result.

     

    regards

     


    To the first question, no. I have all different databases. Nothing close with just different cases, etc.

    For the second request, I linked an excel file with the information:

    Databases...

    EDIT : Bad link before. Try now. Thanks.


    Regards, Christopher K.
    Wednesday, November 24, 2010 3:30 PM
  • Actually, I see:

    tempdb  2
    TempDB 19

    It also looks like your server was probably installed using the Latin1_General_BIN collation.

    So, in Latin1_General_BIN collation, tempdb <> TempDB, but in many other collations they are equal. 

    For example, the sysdbfiles and sysfiles1 'tables' have case sensitive collations in my installation.

    RLF

    Wednesday, November 24, 2010 4:43 PM
  • Actually, I see:

    tempdb  2
    TempDB 19

    It also looks like your server was probably installed using the Latin1_General_BIN collation.

    So, in Latin1_General_BIN collation, tempdb <> TempDB, but in many other collations they are equal. 

    For example, the sysdbfiles and sysfiles1 'tables' have case sensitive collations in my installation.

    RLF


    You are right. After looking at the output of "select * from sys.databases" over again there indeed was two databases named tempdb!

    After renaming the one written as "TempDB" I was able to do everything normally again! Thanks to all that helped.

    One last question. I know that the tempdb is an important database, so should I keep the one written as "tempdb" or the one written as "TempDB"?

    Thanks again!


    Regards, Christopher K.
    Wednesday, November 24, 2010 6:52 PM
  • The tempdb that is dbid 2 is the one to keep. 

    The other one that was TempDB is safely renamed to whatever you chose.

    I also proposed Atta_boy as having the answer.  Perhaps you can mark it "Answered"

    RLF

    Wednesday, November 24, 2010 7:03 PM
  • The tempdb that is dbid 2 is the one to keep. 

    The other one that was TempDB is safely renamed to whatever you chose.

    I also proposed Atta_boy as having the answer.  Perhaps you can mark it "Answered"

    RLF


    Thanks, I will remove that database.

    I marked Atta_boy's response as the answer.


    Regards, Christopher K.
    Saturday, November 27, 2010 5:41 PM