ssrs-2008 – 在SSRS中,为什么在我创建新报告时出现“具有相同键的项目”的错误?

我得到以下错误在SSRS,它一直困惑我一会儿:

An error occurred while the query design method was being saved. 
An item with the same key has already been added

“项目”是什么意思,但?我甚至尝试编辑RDL并删除对存储过程的所有引用,我需要使用称为prc_RPT_Select_BI_Completes_Data_View。

这可能与存储过程使用动态SQL(N’表示法)的事实有关吗?

通过mornin,在存储过程中我有:

SET @SQL = N’
    SELECT bi.SupplierID as”Supplier ID”
            ,bi.SupplierName as”Supplier Name”

        ,bi.PID as ''PID''
        ,bi.RespondentID as ''Respondent ID''

        ,lk_slt.Name as ''Entry Link Type''

        ,ts.SurveyNumber as ''Initial Survey ID'''
看来SSRS有一个问题(至少在2008年版本) – 我在学习this website that explains it

它说如果你有两个列(从2个差异表)有相同的名称,那么它会导致这个问题。

来源:

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, so it was choking.

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.

http://stackoverflow.com/questions/14466874/in-ssrs-why-do-i-get-the-error-item-with-same-key-has-already-been-added-wh

本站文章除注明转载外,均为本站原创或编译
转载请明显位置注明出处:ssrs-2008 – 在SSRS中,为什么在我创建新报告时出现“具有相同键的项目”的错误?