2
我有一個調用存儲過程的報告。該proc有3個參數聲明,但我在運行時收到錯誤「過程沒有參數和參數提供」。我不確定還有什麼要做。SSRS過程沒有參數並提供參數
ALTER PROCEDURE [dbo].[uspFirstCurveProcess] AS
DECLARE @Period int
DECLARE @Year varchar(4)
DECLARE @FacilityID int;
/* SET @period = 4
SET @FacilityID = 3101
SET @Year = 2013; */
WITH Process_cte AS (
SELECT [FacilityID]
,[FiscalYear]
-- ,[MonthNumber]
,[Measure]
,[SubAccount]
,SUM([MthAmt]) AS MthAmt
,SUM([BudgAmt]) AS BudgAmt
,0 AS [YTDAmt]
FROM EVAL.dbo.FirstCurveProcess
WHERE FacilityID = @FacilityID
AND MonthNumber = @Period
AND FiscalYear = @Year
GROUP BY FacilityID,FiscalYear,Measure,Subaccount
UNION
SELECT [FacilityID]
,[FiscalYear]
-- ,[MonthNumber]
,[Measure]
,[SubAccount]
,0 AS [MthAmt]
,0 AS [BudgAmt]
,SUM(MthAmt) AS [YTDAmt]
FROM EVAL.dbo.FirstCurveProcess
WHERE FacilityID = @FacilityID
AND MonthNumber <= @Period
AND FiscalYear = @Year
GROUP BY FacilityID,FiscalYear,Measure,SubAccount --MonthNumber,
)
SELECT [FacilityID]
,[FiscalYear]
-- ,[MonthNumber]
,[Measure]
,[SubAccount]
,SUM([MthAmt]) AS MthAmt
,SUM([BudgAmt]) AS BudgAmt
,SUM(YTDAmt) AS [YTDAmt] FROM Process_cte
GROUP BY FacilityID,FiscalYear,Measure,Subaccount
這是一個參數特定的問題...沒有評論相關的我認爲。 – Riad