Psst! Did you know DevelopmentNow is a mobile web site design agency?

Contact us for help mobilizing your site, or to sign up for our beta Mobile Web SDK!
all groups > sqlserver server > august 2006 >

sqlserver server : Create view with tables from 2 different servers


Ole Kristian Bangås
8/1/2006 2:53:58 PM
"Tim Kelley" <tkelley@company.com> wrote in news:e8Zfl0atGHA.4968
@TK2MSFTNGP03.phx.gbl:

[quoted text, click to view]

I cannot remember anything stating that it does not work, but I guess
you'll have to use sp_addlinkedserver first.

--
Ole Kristian Bangås
Arnie Rowland
8/1/2006 3:27:34 PM
You need to add the remote server as a linked server, using =
sp_addlinkedserver.

Then you can use the four part naming convention.

SELECT=20
l.Column1
, l.Column2
, r.Column1
, r.Column2
FROM LocalTable l
JOIN RemoteServer.DatabaseName.Schema.RemoteTable r
ON l.PKColumn =3D r.FKColumn
WHERE {criteria}


--=20
Arnie Rowland, Ph.D.
Westwood Consulting, Inc

Most good judgment comes from experience.=20
Most experience comes from bad judgment.=20
- Anonymous


"Ole Kristian Bang=E5s" <olekristian.bangas@masterminds.no> wrote in =
message news:Xns9812F31EE656Folekristianbangaas@207.46.248.16...
[quoted text, click to view]
Tim Kelley
8/1/2006 3:57:47 PM
Is it possible to create a view on one SQL server and add a table to the
view from another SQL server?

Tim

AddThis Social Bookmark Button