[AccessD] A2003: Run Query on multiple SQL Servers

Darren D darren at activebilling.com.au
Tue Dec 9 00:12:58 CST 2008


Duh - It should read...

Select * from db1.dbo.Account

Select * from db2.dbo.Account

Select * from db3.dbo.Account

Select * from db4.dbo.Account

But I'm sure you all get the idea :-)
 
Darren

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Darren D
Sent: Tuesday, 9 December 2008 4:30 PM
To: 'Access Developers discussion and problem solving'
Subject: [AccessD] A2003: Run Query on multiple SQL Servers

Hi Team

Using the owner and the dB name I can run a query against a few dB's at once

EG I can get the whole account list for 4 databases

Select * db1.dbo.from Account

Select * db2.dbo.from Account

Select * db3.dbo.from Account

Select * db4.dbo.from Account

Is there a way I can add a Server to this type of thing to get results from
different servers?

Drew posted something where the connection string was passed in the select
statement but I couldn't get that to work - that looked really cool

EG From a Server named OHIO

Select * OHIO.db1.dbo.from Account

Select * OHIO.db2.dbo.from Account

Select * OHIO.db3.dbo.from Account

Select * OHIO.db4.dbo.from Account

EG From a Server named DENVER

Select * DENVER.db1.dbo.from Account

Select * DENVER.db2.dbo.from Account

That way I can get the results from 6 dB's across 2 x servers

Many thanks in advance

Darren

 

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com




More information about the AccessD mailing list