Here is a small sql statement I have worked out.
Code:
SELECT 'Customer1' as [CustomerName], [Field1], [Field2], [Field3], [Field4], [Field5], [Field6]
FROM [Customer1].[dbo].[TransTable]
UNION ALL
SELECT 'Customer2' as [CustomerName], [Field1], [Field2], [Field3], [Field4], [Field5], [Field6]
FROM [Customer2].[dbo].[TransTable];
This is a passthrough query using the ODBC Connect Str of:
Code:
ODBC;Description=MYSERVER;DRIVER=SQL Server;SERVER=MYSERVER;Trusted_Connection=Yes;
I can manually add to this SQL statement for each of the current customers. This will work just fine, except that as new customers come on and old customers leave or go inactive, I will need to update this string. Is there a way I can somehow have the DB name be variable, and somehow use a list of customers to generate the results?