?
Solved

server to server option in SQL

Posted on 2013-01-30
15
Medium Priority
?
296 Views
Last Modified: 2013-02-18
If you have to write from one server to another (or read for that matter), is

1)Linked Server
2)Import/Export
3)BCP

the only options? anything else?
0
Comment
Question by:25112
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 4
  • 3
  • +2
15 Comments
 
LVL 143

Assisted Solution

by:Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3] earned 224 total points
ID: 38835851
you can add replication to the list.

the choice depends on the needs, the volume etc..
for example, is this for a batch?
must the change be part of a "trigger/transaction"?
how many records to be the written/read ?
etc ...
0
 
LVL 75

Assisted Solution

by:Aneesh Retnakaran
Aneesh Retnakaran earned 668 total points
ID: 38835883
+ Bulk insert
0
 
LVL 79

Assisted Solution

by:arnold
arnold earned 888 total points
ID: 38835921
You can have an external mechanism as well.

What is the goal?
0
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 
LVL 5

Author Comment

by:25112
ID: 38835955
the end goal is to do a DELETE or INSERT in 2nd server db from first server, from inside a SP. What would you recommend?

we want to avoid linked server, because there is a linked server already between these 2 servers, and for security reason, management wants only login to be on a linked server between 2 servers.. so we need something other than LS.
0
 
LVL 5

Author Comment

by:25112
ID: 38835962
>>You can have an external mechanism as well.
do you mean ETL like SSIS?
0
 
LVL 75

Assisted Solution

by:Aneesh Retnakaran
Aneesh Retnakaran earned 668 total points
ID: 38836071
if you want to do it within an sp, linked server is the best bet (you can setup SPN for the linked server  or a proxy for best security) ;
other option will be to call 2 sps, first one connect to the first server and executes and then application make another connection to the second server and call the second sp .
0
 
LVL 79

Assisted Solution

by:arnold
arnold earned 888 total points
ID: 38836078
Depending on your programming skills you can create a windows service (vb, c#) that can be run on either or a separate server that will establish a connection into one server and perform transactions while having a second connection to the other database server and perform the transaction it needs.

SSIS is one point.
The issue is more whether you need the two synchronized in real time.  Depending on your need and sql version, database mirroring might be a better option when you can bring up a read only snapshot from the mirrored database.
0
 
LVL 5

Author Comment

by:25112
ID: 38836342
>>other option will be to call 2 sps, first one connect to the first server and executes and then application make another connection to the second server and call the second sp .

you still need a LS with this, right?

is the above in essence the same concept as
"
establish a connection into one server and perform transactions while having a second connection to the other database server and perform the transaction it needs."
0
 
LVL 5

Author Comment

by:25112
ID: 38836344
the 2 dbs are totally different, so mirroring may not be an option.. the proecss we are dealing with is to write or remove a record on the other database, based on some conditions.
0
 
LVL 5

Author Comment

by:25112
ID: 38836347
you can't use bcp for this, can you? (from one sp, write directly into table in another server?)
0
 
LVL 75

Assisted Solution

by:Aneesh Retnakaran
Aneesh Retnakaran earned 668 total points
ID: 38836390
>you still need a LS with this, right?
Nope, you are basically making two seperate connections from the application for calling the two different sps, the issue associated with this will  be it wont be run as one transaction
0
 
LVL 79

Assisted Solution

by:arnold
arnold earned 888 total points
ID: 38836657
An external process either as a service or as a scheduled task is more like what you would need. I.e. it connects into the first to see if there are entries matching the requisite condition, then it does what it needs. either copies the entries from one to the other and deletes, or deletes one from database2.
0
 
LVL 5

Author Comment

by:25112
ID: 38836783
aneeshattingal, thanks

arnold, other than ssis, what are other sql technologies that will come under external processes as you mentioned?
0
 
LVL 70

Assisted Solution

by:Scott Pletcher
Scott Pletcher earned 220 total points
ID: 38837122
Be aware that you can have different callers use different security contexts on the linked server, even though all users are using the same linked server name.

And of course the linked server name doesn't have to bear any relation to the actual server name it links to.  That does make the link more obvious, but in cases where you don't want that, simply pick a different, and non-revealing, name for the linked server:


EXEC sp_addlinkedserver  
   @server='F89C2503DAA5',
   @srvproduct='',
   @provider='SQLNCLI',
   @datasrc='server_name\instance_name'
0
 
LVL 79

Accepted Solution

by:
arnold earned 888 total points
ID: 38837705
The process is outside of sql services/components.
You can use powershell cmndlets, vbscripts, etc. this is a completely separate application that connects to dbserver1 database1 and to dbserver2 database2.
This application performs the queries you deine on each databse without the need to link them.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article I will describe the Detach & Attach method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
This course is ideal for IT System Administrators working with VMware vSphere and its associated products in their company infrastructure. This course teaches you how to install and maintain this virtualization technology to store data, prevent vuln…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

719 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question