Quantcast
Channel: SQL Server Reporting Services, Power View forum
Viewing all articles
Browse latest Browse all 10045

Specify database with a parameter.

$
0
0

We have several databases that are identical except for the name and physical data.  [tables/views etc are all the same]

I want to write a report that the user can select the database with a parameter (or other method), something like:

use @carrier 
select top(2) invNumber from invoices

or

select top(2) invNumber from @carrier.dbo.invoices

Where @carrier would contain the name of the database.  [carrierX, carrierY etc]

I know the above won't work, but is there any way to accomplish the same concept?



Viewing all articles
Browse latest Browse all 10045

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>