Home > database > How to use SQL to a database of a list of the data is inserted into another database table
How to use SQL to a database of a list of the data is inserted into another database table
Time:09-30
How to use SQL to a database of a list of the data is inserted into another database table
CodePudding user response:
Use data pipeline much simple
CodePudding user response:
Insert into t1 select * from shujuku1. Dbo. T2;
CodePudding user response:
create links - serverThe exec sp_addlinkedserver 'srv_lnk', ' 'and' SQLOLEDB ', 'remote server name or IP address' Exec sp_addlinkedsrvlogin 'srv_lnk', 'false', null, 'user name' and 'password' Go
- query example Select * from srv_lnk. Database name. The dbo. Table name
- import the sample Select * into table from srv_lnk. The database name. Dbo. Table name
- later no longer use delete link server The exec sp_dropserver 'srv_lnk', 'droplogins' Go
- if only temporary access, can directly use openrowset - query example Select * from openrowset (' SQLOLEDB ' SQL server name, ' '; 'user name'; 'password' , the database name. Dbo. Table name)
- import the sample Select * into table from openrowset (' SQLOLEDB ' SQL server name, ' '; 'user name'; 'password' , the database name. Dbo. Table name)