简体   繁体   English

如何在ReportsApplication中创建.xsd时使用临时表获取存储过程的结果集

[英]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.

相关问题 如何将存储过程的结果集插入到临时表中并获取Sybase中的输出参数? - How do I insert the result set of a stored procedure into a temp table AND get the output parameters in Sybase? 将存储过程结果集插入临时表并查询临时表 - Insert stored procedure result set into Temp table and query temp table 如何在存储过程循环值中传递参数并将结果集转储到临时表中? - How do I pass a parameter in a stored procedure looping values and dump the result set into a temp table? 如何将单个结果集从返回多个集的 SQL 存储过程保存到临时表? - How to save a single result set to a temp table from a SQL stored procedure returning multiple sets? 如何从PHP Codeigniter中的临时表从MSSQL存储过程获取结果 - How to get result from MSSQL stored procedure with temp table in PHP Codeigniter 选择和更新使用临时表存储过程中的select语句结果 - Select and Update Using the select statement result in temp table stored procedure 如何将存储过程和varchar的结果插入到临时表中? - How to insert result of a stored procedure and a varchar into a temp table? 如何在不声明临时表列的情况下将存储过程的结果插入到临时表中 - How to insert result of Stored Procedure into Temp Table without declaring Temp Table Columns 如何获取从临时表中的存储过程返回的数据集 - How to get a dataset returned from a stored procedure in temp table 如何获取存储过程结果设置值 - How to get the stored procedure result set value
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM