Solved

OPENDATASOURCE

Posted on 2016-07-14
8
35 Views
Last Modified: 2016-09-22
How would i use OPENDATASOURCE to insert the records from a table in one database table to an identically named table in another Sql server instance on another server?
0
Comment
Question by:vbnetcoder
  • 3
  • 3
8 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 41711386
INSERT INTO yourTargetTable
SELECT *  
FROM OPENDATASOURCE( ...)
0
 
LVL 68

Accepted Solution

by:
Qlemo earned 500 total points
ID: 41712687
Why use OpenDataSource? You do not want set up a linked server? In that case you'll need the correct connection string, as always. Assuming you need to use SQL Login instead of Windows Authentication:
insert into Tbl select * from OpenDataSource('SQLNCLI', 'Server=SourceServer\SourceInstance; User=sa; Password=sapwd').SourceDB.dbo.Tbl

Open in new window

0
 

Author Comment

by:vbnetcoder
ID: 41712731
I don't know all the details yet but i was told we maybe not be able to use linked server
0
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 
LVL 68

Expert Comment

by:Qlemo
ID: 41712741
So is the info above sufficient?
0
 

Author Comment

by:vbnetcoder
ID: 41712744
OLemo.  Likely, i will check it out latter today.
0
 
LVL 68

Expert Comment

by:Qlemo
ID: 41811092
#a41712687 is the answer, as far as we can tell. There is not much more to add to that.
0
 

Author Closing Comment

by:vbnetcoder
ID: 41811102
ty
0

Featured Post

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

Suggested Solutions

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
A short film showing how OnPage and Connectwise integration works.

914 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now