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?
vbnetcoderAsked:
Who is Participating?
 
QlemoConnect With a Mentor Batchelor, Developer and EE Topic AdvisorCommented:
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
 
Aneesh RetnakaranDatabase AdministratorCommented:
INSERT INTO yourTargetTable
SELECT *  
FROM OPENDATASOURCE( ...)
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
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
So is the info above sufficient?
0
 
vbnetcoderAuthor Commented:
OLemo.  Likely, i will check it out latter today.
0
 
QlemoBatchelor, Developer and EE Topic AdvisorCommented:
#a41712687 is the answer, as far as we can tell. There is not much more to add to that.
0
 
vbnetcoderAuthor Commented:
ty
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.