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.
| Author |
Topic |
|
raysefo
Constraint Violating Yak Guru
260 Posts |
Posted - 2011-11-22 : 03:29:25
|
| Hi,I would like to join two tables in two different servers. Is there a way to do it?Best Regards. |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-11-22 : 03:44:26
|
yep.add second server as a linked server to first using sp_addlinkedserver and then use likeselect columns..from table1inner join [linkedservername].dbname.dbo.table2on... ------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
raysefo
Constraint Violating Yak Guru
260 Posts |
Posted - 2011-11-22 : 03:49:47
|
| Hi,If it is NOT linked server, is there a way to join?Best regards. |
 |
|
|
raysefo
Constraint Violating Yak Guru
260 Posts |
Posted - 2011-11-22 : 03:51:22
|
| I guess I found outServerName.DbName.dbo.Table |
 |
|
|
visakh16
Very Important crosS Applying yaK Herder
52326 Posts |
Posted - 2011-11-22 : 04:13:49
|
quote: Originally posted by raysefo I guess I found outServerName.DbName.dbo.Table
Unless you add server as a linked server you wont be able to use four part naming convention like aboveIf you dont have linked server setup, then only other way is to use OPENROWSEThttp://msdn.microsoft.com/en-us/library/ms190312.aspx------------------------------------------------------------------------------------------------------SQL Server MVPhttp://visakhm.blogspot.com/ |
 |
|
|
jassi.singh
Posting Yak Master
122 Posts |
Posted - 2011-11-22 : 04:59:13
|
| you need to create linked server to access objects from different servercheck thishttp://www.techrepublic.com/blog/datacenter/how-do-i-query-foreign-data-using-sql-servers-linked-servers/133 |
 |
|
|
|
|
|