SQL Server Import label column

Source: Internet
Author: User
Error 8101
Severity 16
Message Body
Only when the list of columns is used and identity_insert is on can the list be '% 1! ''Specifies an explicit value for the ID column.

Explanation
An attempt is made to insert a row containing a specific Identifier value into a table containing the identifier column. However, the list of columns is not provided or set identity_insert is not enabled for the specified table.

Countermeasure
To successfully insert a specific identification row into a table containing the identification column, you must provide a list of columns and set identity_insert to on. The following example inserts ID Row 2, which defines IID as an ID column.

Table: tbltest
IID strdata
1 King
3 suyama

-- Enable identity_insert.
Set identity_insert tbltest on
Go
-- Insert the specified identity row using a column list.
Insert into tbltest (IID, strdata) values (2, 'davolio ')
Go
-- Disable identity_insert.
Set identity_insert tbltest off
Go

See

Set identity_insert

Emphasize !! Note !! In the import and export wizard, if you select "optimize multiple tables", the mark will be lost! Remember!

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.