在谷歌尝试了很多,我运气不好,在这里,我正在寻求你的帮助。我正在尝试使用存储过程在SSRS中创建数据集,我很难过。有人可以告诉我我失踪的事情吗?
以下是我的存储过程的样子:
CREATE PROCEDURE [dbo].[usp_GetUserData](@ReportRunDate DATE = NULL,
@ReportName VARCHAR(50) = NULL)
AS
BEGIN
WITH CTE
AS (SELECT [USER_ID], [Name], [Address], [DOB], [Status], [UserType], [DateAdded]
FROM [dbo].[User_Information]
WHERE [DateAdded] = @ReportRunDate)
SELECT *
INTO #UserReport
FROM CTE;
IF(@ReportName = 'Internal')
BEGIN
SELECT [USER_ID], [Name], [Address], [DOB]
FROM #InternalReport
WHERE [UserType] = 'Internal';
SELECT *
FROM #InternalReport;
END;
IF(@ReportName = 'External')
BEGIN
SELECT [Name],[Status]
FROM #ExternalReport
WHERE [UserType] = 'External';
SELECT *
FROM #ExternalReport;
END;
END;
我改变了许多人在SO中提到的参数顺序,但这也没有帮助。