Tuesday, March 27, 2012

Creating a view between 2 different Datasources

I want to create a SQL server view that combines 2 tables on 2 different
servers. Both of the servers are in house and I have permission to view
both of them. What is the easiest way to go about doing this?
I am able to create a view with multiple tables on one server but have
never had to create one from multiple datasources.
Let's say that their names are Server_1 and Server_2.
Thanks in advance.
- Will
*** Sent via Developersdex http://www.examnotes.net ***Create a linked server so that Server_1 can see Server_2. Then your view
can work just like any other query:
SELECT <col_list>
FROM databasename.dbo.tablename t1
INNER JOIN [server_2].databasename.dbo.tablename t2
ON t1.key = t2.key;
"Will Chamberlain" <will.chamberlain@.devdex.com> wrote in message
news:uR950C6GGHA.2212@.TK2MSFTNGP15.phx.gbl...
>I want to create a SQL server view that combines 2 tables on 2 different
> servers. Both of the servers are in house and I have permission to view
> both of them. What is the easiest way to go about doing this?
> I am able to create a view with multiple tables on one server but have
> never had to create one from multiple datasources.
> Let's say that their names are Server_1 and Server_2.
> Thanks in advance.
> - Will
> *** Sent via Developersdex http://www.examnotes.net ***

No comments:

Post a Comment