[英]How to get result set of a stored procedure using a temp table while creating .xsd in reportsapplication
I have a stored procedure in SQL Server which runs correctly, I need to use the table returned by it as my data for my report in .rdlc
format. 我在SQL Server中有一个可以正常运行的存储过程,我需要使用它返回的表作为
.rdlc
格式的报告的数据。
EXEC my_stored_procedure @name, @begindate, @enddate
The stored procedure starts like: 存储过程开始如下:
BEGIN
DECLARE ...some variables..
IF OBJECT_ID('tempdb..#proptbl') IS NOT NULL
DROP TABLE #proptbl
END
I am trying to add a dataset using an .xsd to my Report Application in SQL Server Data Tools 2015. 我正在尝试使用.xsd将数据集添加到SQL Server Data Tools 2015中的报表应用程序。
I've created the .rdlc
and need to add an .xsd and connect to rdlc. 我已经创建了
.rdlc
,需要添加.xsd并连接到rdlc。
I added .xsd to the project, added a "table adapter" in it, connected to my database, selected "Use Existing Stored Procedure" as command type, set my procedure in the "select" segment (parameters are not coming, see picture below), check "Fill a datatable" and "Return a datatable". 我在项目中添加了.xsd,在其中添加了“表适配器”,连接到我的数据库,选择了“使用现有存储过程”作为命令类型,在“选择”部分中设置了我的过程(参数没有显示,请参见图片)在下面)中,选中“填充数据表”和“返回数据表”。 At this point when I click next button, I am get this error:
此时,当我单击下一步按钮时,出现此错误:
So there is no data returned. 因此,没有返回数据。 Stacked here, any help would be appreciated.
堆放在这里,任何帮助将不胜感激。 Thanks.
谢谢。
Found my answer here: TableAdapter Configuration Wizard doesn't like temp tables in SP 在这里找到了我的答案: TableAdapter配置向导不喜欢SP中的临时表
Adding this after "AS" keyword at the beginning of the SP helped: 在SP的开头将其添加到“ AS”关键字之后有助于:
IF 1=0 BEGIN
SET FMTONLY OFF
END
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.