No fields for dynamic SQL stored procedure in SSRS with SET FMTONLY

前端 未结 7 1707
栀梦
栀梦 2020-12-17 15:00

I have the following SP which works correctly when ran on its own:

USE [Orders]
GO
SET FMTONLY OFF; 

CREATE PROCEDURE [dbo].[Get_Details_by_Type]

@isArchiv         


        
7条回答
  •  臣服心动
    2020-12-17 15:42

    If anyone is still facing this issue, I solved what appears to be a similar problem with ssrs and dynamic sql.

    1. For ssrs to properly map the fields from the SP,
    2. select the "Text" option under query type,
    3. enter the SP name and parameters like you are calling it from and SSMS window. sp_YourStoredProc @Parameter1....@ParameterN
    4. Click on the refresh fields button.
    5. When the statement runs, the fields will refresh, and your matrix will be populated.

    BTW, I'm using SQL 2012

    Hope this helps.

提交回复
热议问题