Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 selecting database from two different databases

Author  Topic 

qutesanju
Posting Yak Master

193 Posts

Posted - 2011-02-25 : 03:17:25
How to select data from to different servers
e.g server1.database1
and server2.database2

and how will be a sample select statement for this?
i oracle i do remember that using LINK we can achieve this.
in in MS SQL server 2008 i wish to fire this select statement

MIK_2008
Master Smack Fu Yak Hacker

1054 Posts

Posted - 2011-02-25 : 05:02:33
using via linked servers ....

SElect * from [ServerName].[DatabaseName].[SchemaName].[tableName]



Cheers
MIK
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2011-02-26 : 09:36:03
or use OPENDATASOURCE if its for adhoc querying

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -