• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 64
  • Last Modified:

OPENDATASOURCE

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
vbnetcoder
Asked:
vbnetcoder
  • 3
  • 3
1 Solution
 
Aneesh RetnakaranDatabase AdministratorCommented:
INSERT INTO yourTargetTable
SELECT *  
FROM OPENDATASOURCE( ...)
0
 
QlemoC++ DeveloperCommented:
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
 
vbnetcoderAuthor Commented:
I don't know all the details yet but i was told we maybe not be able to use linked server
0
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
QlemoC++ DeveloperCommented:
So is the info above sufficient?
0
 
vbnetcoderAuthor Commented:
OLemo.  Likely, i will check it out latter today.
0
 
QlemoC++ DeveloperCommented:
#a41712687 is the answer, as far as we can tell. There is not much more to add to that.
0
 
vbnetcoderAuthor Commented:
ty
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now