我有一个使用 XML
数据类型的查询。 (您可以在此处查看查询。)
需要明确的是,这意味着我的查询其中有这样的内容:
declare @xmlDoc XML
当我尝试将查询粘贴为 BIDS (Visual Studio 2008) 中的 SQL Server Reporting Services 报告的数据集时,会弹出一个对话框,要求我定义参数:
问题是我没有任何参数!我在查询中定义并使用@xmldoc(它在 SSMS 中运行没有问题)。
我在这里输入什么似乎并不重要。这始终是下一个对话框:
“确定”关闭数据集属性,并且我没有为我设置任何字段。 “取消”让我返回属性并重试。如果我输入没有 XML
数据类型的查询,那么它可以正常工作。
我被难住了...我只能断定SSRS不支持XML数据类型。
这是真的吗?有解决办法吗?
I have an query that uses the XML
data type. (You can see the query here.)
Just to be clear that means that my query has something like this in it:
declare @xmlDoc XML
When I try to paste my query in as a Dataset for a SQL Server Reporting Services Report in BIDS (Visual Studio 2008) a dialog pops asking me to define my parameters:
The problem is that I don't have any Parameters! I define and use @xmldoc in the query (it runs with no issues in SSMS).
It does not really seem to matter what I enter here. This is always the next dialog box:
"OK" closes the Dataset properties and I get no fields setup for me. "Cancel" gets me back to the properties to try again. If I put in a query without the XML
data type then it works fine.
I am stumped... I can only conclude that SSRS does not support the XML data type.
Is that true? Is there a work around?
发布评论
评论(1)
您应该删除变量@xmldoc并在INSERT查询中使用
CAST(@DocParam as XML)
,如下所示:
第二个选项是有2个数据集,第一个设置@xmldoc参数值,第二个在查询中使用参数
第三个选项选项是使用包含所有逻辑的存储过程
You should remove variable @xmldoc and use
CAST(@DocParam as XML)
in INSERT query like this:
Second option is to have 2 DataSets, first sets @xmldoc parameter value and second use parameter in query
An third option is to use stored procedure with all that logic inside