Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Tables from Different connections

Status
Not open for further replies.

bakershawnm

Programmer
Apr 18, 2007
84
US
Hello all,

I currently have 2 sql servers running. Both are 2005. I have some active live information on server1 and some on server2 (I jumped the gun on porting my stuff over before the other DBM got his over). I need to connect some views on server2 to tables/views on server1. I have both servers connected in my SSMS.

First, is it even possible to reference another server from within a view? For example a view on server2 would look like this, "Select * from <server1>.<somedb>.dbo.<sometable/view>"

Second, how would I reference it?

Thanks

 
it was actually a combination of the above thread and this:

SELECT *
FROM OPENQUERY([server1], 'Select * from <somedb>.dbo.<sometable/view>') AS derivedtbl

Thanks goes to George from that other thread.

 
You're welcome. [smile]

-George

"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top