Posted on 2016-07-14
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?
Question by:vbnetcoder
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
  • 3
  • 3
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 41711386
INSERT INTO yourTargetTable
LVL 70

Accepted Solution

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


Author Comment

ID: 41712731
I don't know all the details yet but i was told we maybe not be able to use linked server
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

LVL 70

Expert Comment

ID: 41712741
So is the info above sufficient?

Author Comment

ID: 41712744
OLemo.  Likely, i will check it out latter today.
LVL 70

Expert Comment

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

Author Closing Comment

ID: 41811102

Featured Post

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

'Between' is such a common word we rarely think about it but in SQL it has a very specific definition we should be aware of. While most database vendors will have their own unique phrases to describe it (see references at end) the concept in common …
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor ( Top Charts is a view in which you can set seve…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

691 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