gpt4 book ai didi

ssrs-2008 - 在 SSRS 中,当我制作新报告时,为什么会收到错误 "item with same key has already been added"?

转载 作者:行者123 更新时间:2023-12-03 05:36:39 25 4
gpt4 key购买 nike

我在 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' 表示法)有关吗?

在存储过程中我有:

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'''

enter image description here

最佳答案

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.

关于ssrs-2008 - 在 SSRS 中,当我制作新报告时,为什么会收到错误 "item with same key has already been added"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14466874/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com