SQL Server queries the remote database table data to the local database, sqldb

Source: Internet
Author: User

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?

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.