Only when the column list is used and identity_insert is on can an explicit value be specified for the ID column in The 't_articlefiles 'table.

Source: Internet
Author: User

When importing table data from another database to a database today, the system suddenly prompts "only when the column list is used and the identity_insert is on, you can specify an explicit value for the ID column in the table 't_ articlefiles." At the beginning, I thought I was wrong. Later I found that it was set identity_insert xdsdev. DBO. t_articlefiles on. If I inserted data into the data table, I could not write it directly.

Insert into t_articlefiles select * from XXX. DBO. t_articlefiles to insert data. You must write the data displayed in the t_articlefiles column. In the past, although we knew to directly insert data with auto-incrementing columns to a table with auto-incrementing columns, we had to set the identity_insert of this table to on, but it had never been used, today, I actually used it to know the correct way of writing it. It is indeed a glimpse of the end of the paper.

 

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.