Solved

OPENDATASOURCE

Posted on 2016-07-14
8
30 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
Comment Utility
INSERT INTO yourTargetTable
SELECT *  
FROM OPENDATASOURCE( ...)
0
 
LVL 68

Accepted Solution

by:
Qlemo earned 500 total points
Comment Utility
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
Comment Utility
I don't know all the details yet but i was told we maybe not be able to use linked server
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 68

Expert Comment

by:Qlemo
Comment Utility
So is the info above sufficient?
0
 

Author Comment

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

Expert Comment

by:Qlemo
Comment Utility
#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
Comment Utility
ty
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
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…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

744 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

16 Experts available now in Live!

Get 1:1 Help Now