Table replication between SQL Server databases

Source: Internet
Author: User

Take database T1 and test as an example.

1. Copy the table structure and data select * into database name. DBO. Table name from source table (all data)
For example, select * into t1.dbo. YS1 from test. DBO. dxys: copy the dxys table and data in the test database to the T1 database and name it YS1. The YS1 table in T1 is newly created.
2. Full Replication Insert into database 1. DBO. Table 1 select * from database 2. Table 2, for example, insert into test. DBO. YS Select * from test. DBO. dxys. The data structure of the two tables is the same. The result of this statement is to copy the data in the dxys table to the YS table.
3. Do not copy duplicate records Insert into database 1. Table 1 select distinct * from database 2. Table 2 (No Repeated Records in tabulation 2)
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.