sql - How to insert results from select (from db1) into table (in db2) -


i have 2 databases same table. have connectionstring connect both databases.

how can perform select table a in db1 , insert results in table a in db2?

my connectionstrings:

  • for db1: server=12.34.56.789,12345;database=shop;user id=admin; password=1234567890;
  • for db2: server=34.12.56.789,12345;database=shop;user id=admin; password=1234567890;

try one

/*do target server*/ exec sp_addlinkedserver @server='12.34.56.789,12345' exec sp_addlinkedsrvlogin '12.34.56.789,12345', 'false', null, 'admin', '1234567890'  select * tablea  [12.34.56.789,12345].[shop].[dbo].[tablea] 

Comments

Popular posts from this blog

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

java - How to read a file created at runtime? -

php - Autoloader issue not returning Class -