none
An item with the same key has already been added

    Question

  • Hi All,

    i am getting the following error while refreshing the dataset in sql server 2008 r2.

    An item with the same key has already been added.

    Any solution for this?

    Thanks,

    Mandava

    Monday, December 13, 2010 6:34 AM

Answers

All replies

  • Can you provide more details about this issue?

    Is this related to Reporting Services? Which version of SSRS it is?


    Chaitanya
    Monday, December 13, 2010 6:40 AM
  • Hi Chaitanya,

    Its related to Reporting Services (SSRS 2008 R2).

    Thanks,

    Mandava

    Monday, December 13, 2010 6:45 AM
  • Hi Mandava, can you give me the exact error message, preferrable trying to copy the error message on this..

    Also, if possible check for any errors getting logged in the Reporting Services Log files..


    Chaitanya
    Monday, December 13, 2010 7:31 AM
  • Hi Chaitanya,

    I created the dataset with stored procedure. I updated the stored procedure, in the report i am trying to click refresh fields then i am getting the following error

    could not create a list of fields for the query. verify that you can connect to the datasources and that your quey syntax is correct

    in the details section the following message is displaying

    An item with the same key has already been added.

    Thanks,

    Mandava.

    Monday, December 13, 2010 8:41 AM
  • I guess you might need to delete the dataset and add once again to the Report.
    Chaitanya
    Monday, December 13, 2010 10:47 AM
  • Hi chaitanya,

    I recreated the dataset couple of times,but i am getting the same error.

    i think some of them also facing the same problem.

    please check the below URL

    http://social.msdn.microsoft.com/Forums/en-US/sqlreportingservices/thread/67dc8755-f002-466f-bb7e-1b39514b7c9d 

    If u find any solution please let me know.

    Thanks,

    Mandava.

    Monday, December 13, 2010 10:55 AM
  • Can you quickly confirm the build you are on? You can browse the ReportServer URL, and get the exact version number.

    Are you on : 10.50.1746.0 ? This is the latest build for Reporting Services. Check this: http://blogs.msdn.com/b/sqlreleaseservices/archive/2010/10/18/cumulative-update-4-for-sql-server-2008-r2-rtm.aspx


    Chaitanya
    Monday, December 13, 2010 12:28 PM
  • Hi Chaitanya,

    My reporting server running on sharepoint integrated mode. i am using SQL Server 2008 R2 Enterprise edition.

    in the above link showing diffrent cumilative updated. which one i need to install, Please let me know.

     

    Thanks,

    Mandava.

    Wednesday, December 15, 2010 6:23 AM
  • Hi Chaitanya,

    Microsoft SQL Server Reporting Services Version 10.50.1600.1. this is the build i am using.

    How can i get the latest Build?

    Thanks,

    Mandava.

    Wednesday, December 15, 2010 9:25 AM
  • The latest is CU4 for SQL Server 2008 R2 Reporting Services. here it is: http://support.microsoft.com/kb/2345451

    You can request for the same in the above Support KB, and you will get the CU link in an email.

    Also refer: http://blogs.msdn.com/b/sqlreleaseservices/archive/2010/10/18/cumulative-update-4-for-sql-server-2008-r2-rtm.aspx [Cumulative Update #4 for SQL Server 2008 R2 RTM]

     

    Hope this helps..


    Chaitanya
    Thursday, December 16, 2010 10:49 AM
  • Hi,

    The solution for this issue:

    In my stored procedure, I had inadvertantly included the same column name from two different tables. My query looked something like:

    SELECT a.Field1, a.Field2, a.Field3, b.Field1, b.field99
    FROM TableA a JOIN TableB b on a.Field1 = b.Field1

    SQL handled it just fine, since I had prefixed each with an alias (table) name. But SSRS uses only the column name as the key, not table + column.

    The fix was easy, either rename the second column, i.e. b.Field1 AS Field01 or just omit the field all together, which is what I did.

    After doing this changes in stored proc able to create dataset in SSRS.

    Regards,

    Prabaharan

    • Proposed as answer by CT_Developer Thursday, July 18, 2013 5:57 PM
    Tuesday, November 08, 2011 9:30 AM
  • Even I encountered with the same error message

    in my case, unknowingly my stored procedure was returning to data from 2 different select statements... when I removed one of the select statement.. the all was fine..

    Wednesday, January 11, 2012 3:21 PM
  • For those of us who don't have the luxury of specifying the version and patch level of SSRS, this is a very helpful work around.

    Many thanks, Prabaharan

    Tuesday, June 11, 2013 3:37 PM