SQL Server queries the remote database table data to the local database, sqldb
Step 1:
Sp_configure 'show advanced options', 1; RECONFIGURE; sp_configure 'ad Hoc Distributed Queries ', 1; RECONFIGURE; GO
Step 2:
Insert into table_namecolumnsSELECT columns from openrowset ('sqlcl', 'server = XXXX, 1433; uid = XXXX; pwd = XXXX; Database = cb_name; ', 'select * FROM table_name ')
How can I write SQL statements that SQL Server imports data from a remote database to a local database?
Insert inot user
Select * from opendatasource ('sqloledb', 'server = 192.168.0.1; uid = sa; pwd = dbpasswords; database = dbname'). dbname. dbo. user_copy
How does one import table data from a database on the SQL server Remote server to a database on the local server?
Can you directly access your remote database using the SQL Server Client?
If possible, can you consider establishing a database connection (linked server)
Then
Insert into t_1 select * from connects to the server. t_2 (For details, refer)
To copy the data?