logo
Welcome Guest! To enable all features please Login. New Registrations are disabled.

Notification

Icon
Error

Options
Go to last post Go to first unread
bart  
#1 Posted : Tuesday, March 24, 2009 5:17:27 PM(UTC)
bart

Rank: Administration

Reputation:

Groups: Administration
Joined: 10/8/2008(UTC)
Posts: 188
Man

Was thanked: 1 time(s) in 1 post(s)
To create a query over different servers, catalogs and tables, you have to enable "Ad Hoc Distributed Queries" on the server. This you have to do once. After that you can use OPENDATASOURCE to connect to tables from different servers/catalogs: Example:

Code:
sp_configure 'show advanced options', 1
RECONFIGURE
go
sp_configure 'Ad Hoc Distributed Queries', 1
RECONFIGURE
go

SELECT *
FROM OPENDATASOURCE('SQLNCLI',
    'Data Source=xxx.xxx.xxx.xxx;User ID=USERID;Password=PASSWORD')
    .CatalogName.dbo.tableName

Wanna join the discussion?! Login to your Sienn Forum forum account. New Registrations are disabled.

Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.