Copy a table from the local database to the remote database.

Source: Internet
Author: User

First, the table to be copied is imported to the remote data. Assume that the local table is named hw2 and there is a table named hw in the database with the same structure. There are already 20000 data records.

After the import is successful, a table hw2 is added,

Run the following statement to copy a table hw3

Select * into hw3 from dbo. hw2

Run the following statement to add several records:

Insert into hw (sort3_id, sort2_id, sort_id, hw_name, hw_cash, hw_danwei, hw_content, hw_date, isbn, clerk, admintuijian, tejia, clerk, ZRXS, hw_name2, clerk, baozhuang, clerk, guige, wail, waiw, waih, neural, neihe, chushoutype, hw_content2, neural, neural, pifa, factory_code, pro_code, cqzl, cqmz, tjxs, pp, beizhu, hits)
Select sort3_id, sort2_id, sort_id, hw_name, hw_cash, hw_danwei, hw_content, hw_date, isbn, Beijing, admintuijian, tejia, Hangzhou, ZRXS, hw_name2, Baidu, baozhuang, Baidu, guige, wail, waiw, waih, encrypt, neihe, chushoutype, hw_content2, encrypt, decrypt, pifa, factory_code, pro_code, cqzl, cqmz, tjxs, pp, beizhu, hits from hw2


Note: The preceding field cannot contain ---- Auto-increment columns; otherwise, an error occurs:
"Only when the list of columns is used and IDENTITY_INSERT is ON can an explicit value be specified for the logo column in 'hw 'of the table ."
 

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.