SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Connecting a Remote Sql Server & Accessing


Connecting a Remote Sql Server & Accessing

Author
Message
Mohan Kumar VS
Mohan Kumar VS
SSChasing Mays
SSChasing Mays (638 reputation)SSChasing Mays (638 reputation)SSChasing Mays (638 reputation)SSChasing Mays (638 reputation)SSChasing Mays (638 reputation)SSChasing Mays (638 reputation)SSChasing Mays (638 reputation)SSChasing Mays (638 reputation)

Group: General Forum Members
Points: 638 Visits: 344
Hi

I need to connect two different sql servers across different geographical locations (For eg. one server in UK & other in US).

After the servers are connected, the users should be able to join 2 or more tables from those two remote servers for querying.

Kindly let me know the method.

Rgds
Mohan Kumar VS
Bru Medishetty
Bru Medishetty
SSCrazy Eights
SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)

Group: General Forum Members
Points: 8950 Visits: 1950
You need to setup Linked Server and use 4 part Notation, ex: LinkedServer.Database.Schema.Table in your queries.

Search Google for Linked Server in SQL Server and you will find plenty of example how to setup.


Bru Medishetty

Blog -- LearnSQLWithBru

Join on Facebook Page Facebook.com\LearnSQLWithBru

Twitter -- BruMedishetty
Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (145K reputation)SSC Guru (145K reputation)SSC Guru (145K reputation)SSC Guru (145K reputation)SSC Guru (145K reputation)SSC Guru (145K reputation)SSC Guru (145K reputation)SSC Guru (145K reputation)

Group: General Forum Members
Points: 145987 Visits: 33199
However, joining tables across servers, let alone across oceans, can be very problematic from a performance standpoint. Frequently with linked servers you'll see all the data from the first server moved across to the second as part of the join operation. You might want to reevaluate the solution to determine if you can move the data between the servers in some fashion in order to avoid having to join between them.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
Bru Medishetty
Bru Medishetty
SSCrazy Eights
SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)SSCrazy Eights (9K reputation)

Group: General Forum Members
Points: 8950 Visits: 1950
Agree with Grant's opinion. Linked Servers tend to slow down the query. But it is the only way where you can connect 2 different SQL Servers across different machines.

Depending on your requirement, you may need to evaluate other ways of moving the data to local system and performing the required task.


Bru Medishetty

Blog -- LearnSQLWithBru

Join on Facebook Page Facebook.com\LearnSQLWithBru

Twitter -- BruMedishetty
Mohan Kumar VS
Mohan Kumar VS
SSChasing Mays
SSChasing Mays (638 reputation)SSChasing Mays (638 reputation)SSChasing Mays (638 reputation)SSChasing Mays (638 reputation)SSChasing Mays (638 reputation)SSChasing Mays (638 reputation)SSChasing Mays (638 reputation)SSChasing Mays (638 reputation)

Group: General Forum Members
Points: 638 Visits: 344
Thanks for the suggestions. I understand that this has to be done through linked servers (sp_addlinkedsrvlogin) . But I'm unable to get exact example for connecting to remote server (at a different location). I searched BOL & Google. Kindly give me an example how to connect it.

Rgds
Mohan Kumar VS
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search