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?