开发者

How to set the DB as parameter in SSRS?

开发者 https://www.devze.com 2023-01-31 03:50 出处:网络
I\'m using ReportBuilder 3.0 for creating report in reporting services 2008. I have many DB with the same tables (different da开发者_高级运维ta) and I created a report that can be applied to all these

I'm using ReportBuilder 3.0 for creating report in reporting services 2008. I have many DB with the same tables (different da开发者_高级运维ta) and I created a report that can be applied to all these DB. I want to add a parameter to choose the database so the user can choose the DB from which getting the data. I created a parameter (named "DB") with the name of the DBs as avilable values, but I can't use the parameter in the queries as I was expected:

SELECT *
FROM @DB.[dbo].[TableName]

That query (used in a dataset) doesn't work.

There's a way to set the DB as a parameter?


In TSQL, you would use dynamic sql to do this (EXEC(@CMD)). I doubt report builder will allow you to do this. There are security risks to this.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号