{"Cannot insert an explicit value to an identity column in table ' OrderList ' when IDENTITY_INSERT is set to OFF}For this exception can be handled from two angles: A: Database execution Statement B: Directly modify the persistent class-map profile
Problem description: In SQL SERVER 2008, when inserting data into a field in a data table, an error is given, as follows:When IDENTITY_INSERT is set to OFF, you cannot insert an explicit value into the identity column in table ' OrderList '.Solution:
When IDENTITY_INSERT is set to OFF, you cannot insert an explicit value into the identity column in table ' #TT '.I was in SQL Server to write the stored procedure encountered this error, then thought: how the temporary table has a primary key, I
First, backgroundThe ID field in table A in the SQL Server database is defined as: [ID] [int] IDENTITY, as the data grows, the ID value is close to 2147483647 (the value range for int is:-2 147 483 648 to 2 147 483 647). , although the old data has
A primary key. Two foreign keys,Change the two foreign keys to non-empty on the line.CREATE TABLE [dbo].[User_compare]( [Id] [int] IDENTITY(1,1) not NULL, [UserId] [int] not NULL, [Patentid] [int] not NULL, CONSTRAINT [Pk_user_compare]
http://blog.csdn.net/gane_cheng/article/details/52232238
{You cannot insert an explicit value to an identity column in table ' ClassInfo when IDENTITY_INSERT is set to OFF}
# # #允许将显式值插入表的标识列中 on-allows off-not to allow
set Identity_insert
To insert the value to the automatic number (or the ID column, identity), set identity_insert example: 1. create Table products (ID int identity primary key, product varchar (40. try the following operations in the Table: insert into products (ID,
If we insert a value in the identity column, for example:
Insert member (ID,USERNAME) VALUES (' admin ')
The error message is returned in the Query Analyzer:
Reference content
Server: Message 544, Level 16, State 1, line 1
When IDENTITY_INSERT is
Original: Use SQL statement to create a modified SQL Server identity column (that is, autogrow column)I. Definition and characteristics of the identity columnThe identity column in SQL Server is also called the identifier column, which is also known
I. Definition and characteristics of the identity columnThe identity column in SQL Server is also called the identifier column, which is also known as the self-increment column.This type of column has the following three characteristics:1. The data
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.