小编Pra*_*mar的帖子

当参数中没有值时,如何传递ssrs中表中的所有值?

我正在传递两个参数,即@AccountId@key.我想显示数据库中存在的所有值@AccountId以及@key参数中没有值的时候ie @AccountId@key.我想为同一个数据集执行此操作.这是可能的还是我创建了不同的数据集?

我使用的查询是:

CREATE PROCEDURE [dbo].[GetDenyList]
@AccountId nvarchar(100),
@key nvarchar(400)
AS
select New_AccountId AS 'AccountId/Key', New_Description AS 'Reason',CreatedOn AS 'Date'
  from abc.dbo.New_keydenylist 
 where New_AccountId is not null
   AND @AccountId = New_AccountId
 union all
select new_key AS 'AccountId/Key', New_Description AS 'Reason',CreatedOn AS 'Date' 
  from abc.dbo.New_keydenylist 
 where New_key is not null
   and @Key=New_key
Run Code Online (Sandbox Code Playgroud)

sql sql-server sql-server-2008-r2 reporting-services

6
推荐指数
1
解决办法
948
查看次数