czchlong
czchlong

Reputation: 2584

How to insert records from one DB into another DB on a different server?

I would like to take records from one a table in a SOURCE database and insert these records into a table in a DESTINATION database on a DIFFERENT server with different login credentials.

Could someone please provide points on how this can be done with Sybase TSQL? Or is this not possible?

Upvotes: 0

Views: 677

Answers (1)

Robert
Robert

Reputation: 25753

You can use proxy table as below:

exec sp_addserver 'SvrName', null, '[ip or hostname]:port'
exec sp_addexternlogin 'SvrName', LocalUserName, ExternalUserName, ExternalPassword

create proxy_table proxy_src_tab at 'SvrName.ExternalDb.db_owner.src_table'


insert into dest_tab
select column1,..., columnN from proxy_src_tab

Upvotes: 1

Related Questions